FILE / ScuroNeko/est
internal/ssh/config.go
Исходный файл и его история в репозитории.
21 lines
308 B
Go
21 lines
308 B
Go
package ssh
|
|
|
|
import (
|
|
"os"
|
|
"path/filepath"
|
|
)
|
|
|
|
func getConfigOrEmpty() string {
|
|
homeDir, err := os.UserHomeDir()
|
|
if err != nil {
|
|
return ""
|
|
}
|
|
configPath := filepath.Join(homeDir, ".ssh", "config")
|
|
file, err := os.Open(configPath)
|
|
if err != nil {
|
|
return ""
|
|
}
|
|
_ = file.Close()
|
|
return configPath
|
|
}
|