From b530cba0d546f02f7e046478914900fdd9a05bda Mon Sep 17 00:00:00 2001 From: Andrey Nering Date: Sun, 4 Jun 2017 16:41:38 -0300 Subject: [PATCH] Abstract Tasks type --- cyclic_test.go | 4 ++-- task.go | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/cyclic_test.go b/cyclic_test.go index 8406afa2..ab3c3c45 100644 --- a/cyclic_test.go +++ b/cyclic_test.go @@ -8,7 +8,7 @@ import ( func TestCyclicDepCheck(t *testing.T) { isCyclic := &task.Executor{ - Tasks: map[string]*task.Task{ + Tasks: task.Tasks{ "task-a": &task.Task{ Deps: []string{"task-b"}, }, @@ -23,7 +23,7 @@ func TestCyclicDepCheck(t *testing.T) { } isNotCyclic := &task.Executor{ - Tasks: map[string]*task.Task{ + Tasks: task.Tasks{ "task-a": &task.Task{ Deps: []string{"task-c"}, }, diff --git a/task.go b/task.go index 4e171517..d3903477 100644 --- a/task.go +++ b/task.go @@ -20,13 +20,16 @@ const ( // Executor executes a Taskfile type Executor struct { - Tasks map[string]*Task + Tasks Tasks Force bool Watch bool watchingFiles map[string]struct{} } +// Tasks representas a group of tasks +type Tasks map[string]*Task + // Task represents a task type Task struct { Cmds []string