From 3821d2507acbbe392289bff797d1bbd186423b6e Mon Sep 17 00:00:00 2001 From: Andreas Mieke Date: Tue, 1 Nov 2016 23:41:37 +0100 Subject: [PATCH] Changes code to use environment variable for home directory --- gparser/main.go | 2 +- gserver/main.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/gparser/main.go b/gparser/main.go index 343e0ef..1dc1b1f 100644 --- a/gparser/main.go +++ b/gparser/main.go @@ -23,7 +23,7 @@ func main() { if os.Getenv("GIN_MODE") == "release" { err = config.LoadConfig("/etc/gogronkh/gronkh.json") } else { - err = config.LoadConfig("/home/andreas/.gronkh.json") + err = config.LoadConfig(os.Getenv("HOME") + "/.gronkh.json") } if err != nil { log.Fatalf("FAT Config error: %+v", err) diff --git a/gserver/main.go b/gserver/main.go index d931ba8..cd894f6 100644 --- a/gserver/main.go +++ b/gserver/main.go @@ -101,7 +101,7 @@ func main() { if os.Getenv("GIN_MODE") == "release" { err = config.LoadConfig("/etc/gogronkh/gronkh.json") } else { - err = config.LoadConfig("/home/andreas/.gronkh.json") + err = config.LoadConfig(os.Getenv("HOME") + "/.gronkh.json") } if err != nil { log.Fatalf("FAT Config error: %+v", err)