From 72cfd2966b0de3ae96a37005848087055c4b944a Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Sat, 3 Jun 2017 15:30:00 +0200 Subject: Move 'fields.go' to 'project.go' Get rid of all the old commented Fields code. It's no longer used and is no longer relevant. Furthermore, since the only thing left in this file is the `Project` struct, rename the file to 'project.go'. --- timetask/fields.go | 94 ------------------------------------------------------ 1 file changed, 94 deletions(-) delete mode 100644 timetask/fields.go (limited to 'timetask/fields.go') diff --git a/timetask/fields.go b/timetask/fields.go deleted file mode 100644 index 9f7aa99..0000000 --- a/timetask/fields.go +++ /dev/null @@ -1,94 +0,0 @@ -package timetask - -// import "fmt" - -// type Client struct { -// ID int -// Name string -// Projects []Project -// } - -// type Project struct { -// ID int -// Name string -// Modules []Module -// Tasks []Task -// WorkTypes []WorkType `yaml:"work_types"` -// } - -type Project struct { - Client int - Project int - Module int - Task int - WorkType int `toml:"work_type"` - Billable bool -} - -// type Module struct { -// ID int -// Name string -// } -// type Task struct { -// ID int -// Name string -// } -// type WorkType struct { -// ID int -// Name string -// } -// -// type Fields struct { -// PersonID int `yaml:"person_id"` -// Clients []Client -// } -// -// func (f *Fields) ClientByName(client_name string) (*Client, error) { -// for _, client := range f.Clients { -// if client.Name == client_name { -// return &client, nil -// } -// } -// -// return nil, fmt.Errorf("Client %s not found", client_name) -// } -// -// func (c *Client) ProjectByName(project_name string) (*Project, error) { -// for _, project := range c.Projects { -// if project.Name == project_name { -// return &project, nil -// } -// } -// -// return nil, fmt.Errorf("Project %s not found", project_name) -// } -// -// func (p *Project) ModuleByName(module_name string) (*Module, error) { -// for _, module := range p.Modules { -// if module.Name == module_name { -// return &module, nil -// } -// } -// -// return nil, fmt.Errorf("Module %s not found", module_name) -// } -// -// func (p *Project) TaskByName(task_name string) (*Task, error) { -// for _, task := range p.Tasks { -// if task.Name == task_name { -// return &task, nil -// } -// } -// -// return nil, fmt.Errorf("Task %s not found", task_name) -// } -// -// func (p *Project) WorkTypeByName(work_type_name string) (*WorkType, error) { -// for _, work_type := range p.WorkTypes { -// if work_type.Name == work_type_name { -// return &work_type, nil -// } -// } -// -// return nil, fmt.Errorf("Work type %s not found", work_type_name) -// } -- cgit v1.2.3