From 1a871c89dad3a0b9ad8adb8d27bb132f295a5702 Mon Sep 17 00:00:00 2001 From: Ayman Bagabas Date: Fri, 3 Jun 2022 17:16:02 -0400 Subject: [PATCH] fix(config): use errors.Is instead of os.IsNotExist --- internal/config/config.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/internal/config/config.go b/internal/config/config.go index f1c1ca31f0de50a71a737cf98d33dbf2127f89aa..86cbc52b734dc1281c6ed0f6debc59f5523aa2cf 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -2,6 +2,8 @@ package config import ( "bytes" + "errors" + "io/fs" "log" "path/filepath" "strings" @@ -190,7 +192,7 @@ func (cfg *Config) createDefaultConfigRepo(yaml string) error { rp := filepath.Join(cfg.Cfg.RepoPath, cn) rs := cfg.Source err := rs.LoadRepo(cn) - if os.IsNotExist(err) { + if errors.Is(err, fs.ErrNotExist) { log.Printf("creating default config repo %s", cn) repo, err := ggit.PlainInit(rp, true) if err != nil {