From 1a1d9c3c671d33f7013c94564007e2c5b33cea47 Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Sat, 3 Jun 2017 10:42:54 +0200 Subject: main.go: Cleanup from 13c84cd9973458750305c72a919cf921d9b22b04 * Get rid of the 'yaml' import since we're now using 'toml' instead. * Get rid of commented code that's no longer relevant. * Get rid of test code that checked that the config loaded correctly. --- main.go | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) (limited to 'main.go') diff --git a/main.go b/main.go index bfb56b8..61cdce6 100644 --- a/main.go +++ b/main.go @@ -9,22 +9,12 @@ import ( "github.com/teddywing/timetasker/timetask" "github.com/BurntSushi/toml" - "gopkg.in/yaml.v2" ) -// type Config struct { -// Auth struct { -// Username string -// PasswordCmd string `yaml:"password_cmd"` -// } -// Fields timetask.Fields -// Defaults timetask.TimeEntry -// } - type Config struct { Auth struct { Username string - PasswordCmd string //`toml:"password_cmd"` + PasswordCmd string } Projects map[string]interface{} } @@ -33,8 +23,6 @@ var config Config func main() { loadConfig() - log.Printf("%+v", config) - return if len(os.Args) == 1 { fmt.Println("Not enough arguments") @@ -61,7 +49,6 @@ func main() { } func loadConfig() { - // config_str, err := ioutil.ReadFile("config2.toml") config = Config{} _, err := toml.DecodeFile("config2.toml", &config) if err != nil { -- cgit v1.2.3