diff options
| author | Teddy Wing | 2017-03-12 17:38:19 +0100 | 
|---|---|---|
| committer | Teddy Wing | 2017-03-12 17:38:19 +0100 | 
| commit | d9ca7b7d412f34f0d1f93a04c7c566f041b99524 (patch) | |
| tree | d5d6098c7ec26f644e0e52b54696b13cc14dff47 | |
| parent | 2404a41cf283b9f390e8dac1f678066a85dc1e53 (diff) | |
| download | timetasker-d9ca7b7d412f34f0d1f93a04c7c566f041b99524.tar.bz2 | |
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.
| -rw-r--r-- | timetask/fields.go | 26 | 
1 files changed, 16 insertions, 10 deletions
| 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"` | 
