add rootpath to config

master
kreativmonkey 7 years ago
parent 6acc5619e7
commit ec4dfd6d43

@ -7,14 +7,15 @@ import (
) )
func DefaultConfig() Config { func DefaultConfig() Config {
return Config{ c := Config{
DB: "./sgot.db", RootPath: "./",
APIkey: "thisIsNotASecretTokenNow", APIkey: "thisIsNotASecretTokenNow",
Host: "localhost", Host: "localhost",
Port: "6889", Port: "6889",
Title: "Sgot", Title: "Sgot",
RootPath: "./",
} }
c.DB = c.RootPath + "shrty.go"
return c
} }
type Config struct { type Config struct {

@ -24,7 +24,7 @@ func TestConfig_ReadConfig(t *testing.T){
"--title=title", "--title=title",
"--apikey=apikey", "--apikey=apikey",
"--domain=domain", "--domain=domain",
"--root=root" "--root=root",
} }
expected := &Config{ expected := &Config{

Loading…
Cancel
Save