From ec4dfd6d43364cf3cfa37e02eec2257f7c460857 Mon Sep 17 00:00:00 2001 From: kreativmonkey Date: Wed, 5 Jul 2017 16:07:18 +0200 Subject: [PATCH] add rootpath to config --- config.go | 7 ++++--- config_test.go | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/config.go b/config.go index 7830b8a..eb748cd 100644 --- a/config.go +++ b/config.go @@ -7,14 +7,15 @@ import ( ) func DefaultConfig() Config { - return Config{ - DB: "./sgot.db", + c := Config{ + RootPath: "./", APIkey: "thisIsNotASecretTokenNow", Host: "localhost", Port: "6889", Title: "Sgot", - RootPath: "./", } + c.DB = c.RootPath + "shrty.go" + return c } type Config struct { diff --git a/config_test.go b/config_test.go index 9bb8bac..4f50816 100644 --- a/config_test.go +++ b/config_test.go @@ -24,7 +24,7 @@ func TestConfig_ReadConfig(t *testing.T){ "--title=title", "--apikey=apikey", "--domain=domain", - "--root=root" + "--root=root", } expected := &Config{