diff options
author | Simon Ser <contact@emersion.fr> | 2020-06-21 14:16:42 +0000 |
---|---|---|
committer | Hubert Hirtz <hubert@hirtzfr.eu> | 2020-06-21 17:01:59 +0200 |
commit | 3a330b919b50d715be4b34d4af509730d87c99b1 (patch) | |
tree | b3d0a9f15f4e591c835e6cc383860a58c41c7862 /cmd | |
parent | readme: fix example config (diff) |
Use os.UserConfigDir
By using this function we become compliant with the XDG base directory
spec (XDG_CONFIG_HOME is used if set).
Diffstat (limited to 'cmd')
-rw-r--r-- | cmd/irc/main.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/cmd/irc/main.go b/cmd/irc/main.go index 1cfb5da..e8aaaa9 100644 --- a/cmd/irc/main.go +++ b/cmd/irc/main.go @@ -9,7 +9,7 @@ import ( "github.com/gdamore/tcell" "hash/fnv" "log" - "os/user" + "os" "strings" "time" ) @@ -17,12 +17,12 @@ import ( func main() { tcell.SetEncodingFallback(tcell.EncodingFallbackASCII) - usr, err := user.Current() + configDir, err := os.UserConfigDir() if err != nil { log.Panicln(err) } - cfg, err := senpai.LoadConfigFile(usr.HomeDir + "/.config/senpai/senpai.yaml") + cfg, err := senpai.LoadConfigFile(configDir + "/senpai/senpai.yaml") if err != nil { log.Panicln(err) } |