diff --git a/.goxc.json b/.goxc.json index 11ec1f4..80b9e8f 100644 --- a/.goxc.json +++ b/.goxc.json @@ -7,6 +7,7 @@ "go-fmt", "go-install", "go-clean", + "xc", "publish-github" ], "TaskSettings": { diff --git a/.travis.yml b/.travis.yml index f4876db..9128e1c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,7 @@ language: go sudo: required go: - - 1.5.1 + - 1.6.2 - tip env: diff --git a/lib/settings.go b/lib/settings.go index 81beaf3..cf70477 100644 --- a/lib/settings.go +++ b/lib/settings.go @@ -50,7 +50,11 @@ func InitSettings(configFile string, settings *SettingsShare) error { log.Info("New config file: %s\n", configFile) *settings = NewSettings() - CreateConfigFile(configFile, *settings) + err := CreateConfigFile(configFile, *settings) + + if err != nil { + return err + } } else { log.Info("Loading config file: %s\n", configFile) if _, err := toml.DecodeFile(configFile, &settings); err != nil { diff --git a/lib/settings_test.go b/lib/settings_test.go index dc93d4b..da1d5ca 100644 --- a/lib/settings_test.go +++ b/lib/settings_test.go @@ -17,13 +17,13 @@ func TempFilename(prefix string, extension string) string { } func TestCreateConfigFile(t *testing.T) { - test_settings = NewSettings() + var test_settings SettingsShare configFile := TempFilename("config_", ".toml") err := CreateConfigFile(configFile, test_settings) assert.Nil(t, err) - _, err2 := os.Stat(test_settings.Daemon.DatabaseFilePath) + _, err2 := os.Stat(configFile) assert.False(t, os.IsNotExist(err2), "The config file: %s doesn't exists!", configFile) }