From e29d17784e0fb7e8dcd111da2592fd3a3dd44a1b Mon Sep 17 00:00:00 2001 From: JamesClonk Date: Mon, 13 Jan 2014 20:32:21 +0100 Subject: [PATCH] Ready for new release, v1.2 --- README.md | 5 +---- todotxt_test.go | 19 +++---------------- 2 files changed, 4 insertions(+), 20 deletions(-) diff --git a/README.md b/README.md index d38f1d6..28ee3d6 100644 --- a/README.md +++ b/README.md @@ -42,10 +42,7 @@ go-todotxt requires Go1.1 or higher. // Filter list to get only completed tasks completedList := testTasklist.Filter(func(t Task) bool { - if t.Completed { - return true - } - return false + return t.Completed }) fmt.Print(completedList) } diff --git a/todotxt_test.go b/todotxt_test.go index 2021d73..9a28e20 100644 --- a/todotxt_test.go +++ b/todotxt_test.go @@ -422,12 +422,7 @@ func TestTaskListFilter(t *testing.T) { } // Filter list to get only completed tasks - completedList := testTasklist.Filter(func(t Task) bool { - if t.Completed { - return true - } - return false - }) + completedList := testTasklist.Filter(func(t Task) bool { return t.Completed }) testExpected = 33 testGot = len(*completedList) if testGot != testExpected { @@ -435,12 +430,7 @@ func TestTaskListFilter(t *testing.T) { } // Filter list to get only tasks with a due date - dueDateList := testTasklist.Filter(func(t Task) bool { - if t.HasDueDate() { - return true - } - return false - }) + dueDateList := testTasklist.Filter(func(t Task) bool { return t.HasDueDate() }) testExpected = 26 testGot = len(*dueDateList) if testGot != testExpected { @@ -449,10 +439,7 @@ func TestTaskListFilter(t *testing.T) { // Filter list to get only tasks with "B" priority prioBList := testTasklist.Filter(func(t Task) bool { - if t.HasPriority() && t.Priority == "B" { - return true - } - return false + return t.HasPriority() && t.Priority == "B" }) testExpected = 17 testGot = len(*prioBList)