From 12c0d189328a9bf9e5288bc5fcc70e4a23b82acf Mon Sep 17 00:00:00 2001 From: Andrey Nering Date: Sat, 3 Mar 2018 18:56:15 -0300 Subject: [PATCH] Move setting of default version to "taskfile" package --- internal/taskfile/taskfile.go | 1 + task.go | 3 --- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/internal/taskfile/taskfile.go b/internal/taskfile/taskfile.go index c7c1ce63..b4ce79f4 100644 --- a/internal/taskfile/taskfile.go +++ b/internal/taskfile/taskfile.go @@ -9,6 +9,7 @@ type Taskfile struct { // UnmarshalYAML implements yaml.Unmarshaler interface func (tf *Taskfile) UnmarshalYAML(unmarshal func(interface{}) error) error { if err := unmarshal(&tf.Tasks); err == nil { + tf.Version = "1" return nil } diff --git a/task.go b/task.go index ca69ddcb..b05065cd 100644 --- a/task.go +++ b/task.go @@ -78,9 +78,6 @@ func (e *Executor) Run(calls ...taskfile.Call) error { } func (e *Executor) setup() error { - if e.Taskfile.Version == "" { - e.Taskfile.Version = "1" - } v, err := semver.NewVersion(e.Taskfile.Version) if err != nil { return fmt.Errorf(`task: could not parse taskfile version "%s": %v`, e.Taskfile.Version, err)