Fix noinlineerr findings: internal/cli (refs #61)
This commit is contained in:
@@ -75,7 +75,8 @@ func GetRootFlags() RootFlags {
|
||||
// so the user gets a clear error instead of a downstream YAML parser failure.
|
||||
func ResolveConfigPath() (string, error) {
|
||||
if path := rootFlags.ConfigPath; path != "" {
|
||||
if _, err := os.Stat(path); err != nil {
|
||||
_, err := os.Stat(path)
|
||||
if err != nil {
|
||||
return "", fmt.Errorf("config file from --config not found: %s (run 'vaultik config init --config %s' to create it)", path, path)
|
||||
}
|
||||
|
||||
@@ -91,7 +92,8 @@ func ResolveConfigPath() (string, error) {
|
||||
}
|
||||
|
||||
for _, path := range defaultConfigPaths() {
|
||||
if _, err := os.Stat(path); err == nil {
|
||||
_, err := os.Stat(path)
|
||||
if err == nil {
|
||||
return path, nil
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user