From d9ca7b7d412f34f0d1f93a04c7c566f041b99524 Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Sun, 12 Mar 2017 17:38:19 +0100 Subject: fields.go: Get rid of `IDName` Embedding this struct prevented us from correctly unmarshalling data into them. This is because they need to be created like: Client{IDName{ID: , Name: ,}} The fields can't be added in directly. Save ourselves the headache and just manually repeat the fields. So that importing works right. --- timetask/fields.go | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) (limited to 'timetask') diff --git a/timetask/fields.go b/timetask/fields.go index 84bf93a..4e3ac7c 100644 --- a/timetask/fields.go +++ b/timetask/fields.go @@ -1,25 +1,31 @@ package timetask -type IDName struct { - ID uint - Name string -} - type Client struct { - IDName + ID uint + Name string Projects []Project } type Project struct { - IDName + ID uint + Name string Modules []Module Tasks []Task WorkTypes []WorkType `yaml:"work_types"` } -type Module IDName -type Task IDName -type WorkType IDName +type Module struct { + ID uint + Name string +} +type Task struct { + ID uint + Name string +} +type WorkType struct { + ID uint + Name string +} type Fields struct { PersonID uint `yaml:"person_id"` -- cgit v1.2.3