We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6fdbb64 commit adcd93dCopy full SHA for adcd93d
config.go
@@ -29,9 +29,12 @@ type config struct {
29
// empty value of Config.
30
func newConfig(root string) (c config, err error) {
31
filename := filepath.Join(root, ConfigFile)
32
- if _, err = os.Stat(filename); os.IsNotExist(err) {
33
- err = nil // do not consider a missing config file an error
34
- return // return the zero value of the config
+ if _, err = os.Stat(filename); err != nil {
+ // do not consider a missing config file an error. Just return.
+ if os.IsNotExist(err) {
35
+ err = nil
36
+ }
37
+ return
38
}
39
bb, err := ioutil.ReadFile(filename)
40
if err != nil {
0 commit comments