Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion cmd/hranoprovod-cli/internal/options/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ func (o *Options) Load(c *cli.Context, useConfigFile bool) error {
}
// Non existing file passed
if !exists && c.IsSet("config") {
return errors.New("File " + fileName + "not found")
return errors.New("File " + fileName + " not found")
}
if exists {
if f, err := os.Open(fileName); err != nil {
Expand Down Expand Up @@ -104,6 +104,9 @@ func validateOptions(c *cli.Context, o *Options) error {

func fileExists(name string) (bool, error) {
_, err := os.Stat(name)
if err == nil {
return true, nil
}
if os.IsNotExist(err) {
return false, nil
}
Expand Down