diff --git a/task.go b/task.go index 0afe2215..f339fbc3 100644 --- a/task.go +++ b/task.go @@ -80,7 +80,6 @@ func (e *Executor) Run(ctx context.Context, calls ...*Call) error { g, ctx := errgroup.WithContext(ctx) for _, c := range regularCalls { - c := c if e.Parallel { g.Go(func() error { return e.RunTask(ctx, c) }) } else { @@ -264,7 +263,6 @@ func (e *Executor) runDeps(ctx context.Context, t *ast.Task) error { defer reacquire() for _, d := range t.Deps { - d := d g.Go(func() error { err := e.RunTask(ctx, &Call{Task: d.Task, Vars: d.Vars, Silent: d.Silent, Indirect: true}) if err != nil { diff --git a/taskfile/ast/tasks.go b/taskfile/ast/tasks.go index 783cd6c3..6cda20bf 100644 --- a/taskfile/ast/tasks.go +++ b/taskfile/ast/tasks.go @@ -244,8 +244,8 @@ func (t *Tasks) UnmarshalYAML(node *yaml.Node) error { } func taskNameWithNamespace(taskName string, namespace string) string { - if strings.HasPrefix(taskName, NamespaceSeparator) { - return strings.TrimPrefix(taskName, NamespaceSeparator) + if after, ok := strings.CutPrefix(taskName, NamespaceSeparator); ok { + return after } return fmt.Sprintf("%s%s%s", namespace, NamespaceSeparator, taskName) } diff --git a/watch.go b/watch.go index 651dc300..225045b8 100644 --- a/watch.go +++ b/watch.go @@ -36,7 +36,6 @@ func (e *Executor) watchTasks(calls ...*Call) error { ctx, cancel := context.WithCancel(context.Background()) for _, c := range calls { - c := c go func() { err := e.RunTask(ctx, c) if err == nil { @@ -85,7 +84,6 @@ func (e *Executor) watchTasks(calls ...*Call) error { e.Compiler.ResetCache() for _, c := range calls { - c := c go func() { if ShouldIgnore(event.Name) { e.Logger.VerboseErrf(logger.Magenta, "task: event skipped for being an ignored dir: %s\n", event.Name)