From 32af022cc4b6d7a2b1bf1fc2bb49bb6b84992187 Mon Sep 17 00:00:00 2001 From: Huu Nguyen Date: Sat, 14 Jan 2017 22:04:47 -0800 Subject: Run gofmt on formatter and parser --- todolist/formatter.go | 2 +- todolist/parser.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'todolist') diff --git a/todolist/formatter.go b/todolist/formatter.go index c884862..b259f6a 100644 --- a/todolist/formatter.go +++ b/todolist/formatter.go @@ -29,7 +29,7 @@ func (f *Formatter) Print() { cyan := color.New(color.FgCyan).SprintFunc() var keys []string - for key, _ := range f.GroupedTodos.Groups { + for key := range f.GroupedTodos.Groups { keys = append(keys, key) } sort.Strings(keys) diff --git a/todolist/parser.go b/todolist/parser.go index 433cfc6..c52f131 100644 --- a/todolist/parser.go +++ b/todolist/parser.go @@ -57,7 +57,7 @@ func (p *Parser) Due(input string, day time.Time) string { r, _ := regexp.Compile(`due .*$`) res := r.FindString(input) - res = res[4:len(res)] + res = res[4:] switch res { case "none": return "" @@ -163,7 +163,7 @@ func (p *Parser) matchWords(input string, r *regexp.Regexp) []string { ret := []string{} for _, val := range results { - ret = append(ret, val[1:len(val)]) + ret = append(ret, val[1:]) } return ret } -- cgit v1.3 From e85b6a5c808ad579e9cc81c57fccccd2498819dc Mon Sep 17 00:00:00 2001 From: Quey-Liang Kao Date: Tue, 17 Jan 2017 03:59:15 +0800 Subject: Provide a more helpful message --- todolist/app.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'todolist') diff --git a/todolist/app.go b/todolist/app.go index 7644d46..45b9812 100644 --- a/todolist/app.go +++ b/todolist/app.go @@ -26,7 +26,7 @@ func (a *App) AddTodo(input string) { parser := &Parser{} todo := parser.ParseNewTodo(input) if todo == nil { - fmt.Println("What to do?") + fmt.Println("I need more information. Try something like 'todo a chat with @bob due tom'") return } -- cgit v1.3