From d998a82d4019b1fc5a15734f091852b1b0f086d4 Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Sat, 3 Jun 2017 11:24:55 +0200 Subject: Create a new Project type This corresponds to a "project" entry in the new config2.toml file. (See 13c84cd9973458750305c72a919cf921d9b22b04). Instead of decoding generic `interface{}`s as projects from the TOML, make them a real type. The reason why we're using `int`s where we used to use strings is that the new TOML format will have users write IDs directly in the config file, instead of having the program automatically search for those IDs and use them as we had previously designed. Maybe we'll bring that functionality back at some point, but for now it's too bothersome to implement and I don't consider it worth the trouble. --- main.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'main.go') diff --git a/main.go b/main.go index b31a4f0..ccdcaed 100644 --- a/main.go +++ b/main.go @@ -6,7 +6,7 @@ import ( "log" // "os" - // "github.com/teddywing/timetasker/timetask" + "github.com/teddywing/timetasker/timetask" "github.com/BurntSushi/toml" ) @@ -16,7 +16,7 @@ type Config struct { Username string PasswordCmd string } - Projects map[string]interface{} + Projects map[string]timetask.Project } var config Config -- cgit v1.2.3