Skip to content

Commit b530cba

Browse files
committed
Abstract Tasks type
1 parent 09e6d52 commit b530cba

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

cyclic_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import (
88

99
func TestCyclicDepCheck(t *testing.T) {
1010
isCyclic := &task.Executor{
11-
Tasks: map[string]*task.Task{
11+
Tasks: task.Tasks{
1212
"task-a": &task.Task{
1313
Deps: []string{"task-b"},
1414
},
@@ -23,7 +23,7 @@ func TestCyclicDepCheck(t *testing.T) {
2323
}
2424

2525
isNotCyclic := &task.Executor{
26-
Tasks: map[string]*task.Task{
26+
Tasks: task.Tasks{
2727
"task-a": &task.Task{
2828
Deps: []string{"task-c"},
2929
},

task.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,16 @@ const (
2020

2121
// Executor executes a Taskfile
2222
type Executor struct {
23-
Tasks map[string]*Task
23+
Tasks Tasks
2424
Force bool
2525
Watch bool
2626

2727
watchingFiles map[string]struct{}
2828
}
2929

30+
// Tasks representas a group of tasks
31+
type Tasks map[string]*Task
32+
3033
// Task represents a task
3134
type Task struct {
3235
Cmds []string

0 commit comments

Comments
 (0)