From ca91b25b023fb67e9f809abe7a3a23868ce2f8fa Mon Sep 17 00:00:00 2001 From: Chris Lane Date: Wed, 29 Jan 2020 14:05:27 -0500 Subject: [PATCH] fix: logging on failed configs Fixes an issue whereby the error message generated when a config file could not be loaded (due to a symlink resolution failure) would fail to print the config file path to `stderr`. --- internal/config/config.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/internal/config/config.go b/internal/config/config.go index e40a079..040f645 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -75,14 +75,16 @@ func New(opts map[string]interface{}, confPath string, resolve bool) (Config, er // `resolve` is a switch that allows us to turn off symlink resolution when // running the config tests. if resolve { - expanded, err = filepath.EvalSymlinks(expanded) + evaled, err := filepath.EvalSymlinks(expanded) if err != nil { return Config{}, fmt.Errorf( - "failed to resolve symlink: %s, %v", + "failed to resolve symlink: %s: %v", expanded, err, ) } + + expanded = evaled } conf.Cheatpaths[i].Path = expanded