From ca2eaad606ac9ebaa4e827b30deb8881f341c220 Mon Sep 17 00:00:00 2001 From: Nick White Date: Mon, 27 Jul 2020 15:08:29 +0100 Subject: Use os.Getenv() to find config dir, rather than rely on os.UserConfigDir(), as that isnt present on go1.11 --- cmd/bookpipeline/main.go | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'cmd') diff --git a/cmd/bookpipeline/main.go b/cmd/bookpipeline/main.go index 0bd1eb2..9bc3378 100644 --- a/cmd/bookpipeline/main.go +++ b/cmd/bookpipeline/main.go @@ -90,11 +90,7 @@ type mailSettings struct { } func getMailSettings() (mailSettings, error) { - confdir, err := os.UserConfigDir() - if err != nil { - return mailSettings{}, fmt.Errorf("Error finding UserConfigDir for mailsettings: %v", err) - } - p := filepath.Join(confdir, "bookpipeline", "mailsettings") + p := filepath.Join(os.Getenv("HOME"), ".config", "bookpipeline", "mailsettings") b, err := ioutil.ReadFile(p) if err != nil { return mailSettings{}, fmt.Errorf("Error reading mailsettings from %s: %v", p, err) -- cgit v1.2.1-24-ge1ad