From b6b72e389d5631b7d22e94603d51551f580cc583 Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Fri, 9 Dec 2022 13:34:20 +0000 Subject: [PATCH] internal: dont error if environment config isn't found Signed-off-by: Jens Langhammer --- internal/config/config.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/internal/config/config.go b/internal/config/config.go index 07a95da52..01ca493b2 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -1,6 +1,7 @@ package config import ( + "errors" "fmt" "net/url" "os" @@ -62,6 +63,9 @@ func (c *Config) Setup(paths ...string) { func (c *Config) LoadConfig(path string) error { raw, err := os.ReadFile(path) if err != nil { + if errors.Is(err, os.ErrNotExist) { + return nil + } return fmt.Errorf("failed to load config file: %w", err) } err = yaml.Unmarshal(raw, c)