Skip to content

Commit c7b4f26

Browse files
committed
chore: run modernize
1 parent 3ed403b commit c7b4f26

File tree

3 files changed

+2
-6
lines changed

3 files changed

+2
-6
lines changed

task.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,6 @@ func (e *Executor) Run(ctx context.Context, calls ...*Call) error {
8080

8181
g, ctx := errgroup.WithContext(ctx)
8282
for _, c := range regularCalls {
83-
c := c
8483
if e.Parallel {
8584
g.Go(func() error { return e.RunTask(ctx, c) })
8685
} else {
@@ -264,7 +263,6 @@ func (e *Executor) runDeps(ctx context.Context, t *ast.Task) error {
264263
defer reacquire()
265264

266265
for _, d := range t.Deps {
267-
d := d
268266
g.Go(func() error {
269267
err := e.RunTask(ctx, &Call{Task: d.Task, Vars: d.Vars, Silent: d.Silent, Indirect: true})
270268
if err != nil {

taskfile/ast/tasks.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -244,8 +244,8 @@ func (t *Tasks) UnmarshalYAML(node *yaml.Node) error {
244244
}
245245

246246
func taskNameWithNamespace(taskName string, namespace string) string {
247-
if strings.HasPrefix(taskName, NamespaceSeparator) {
248-
return strings.TrimPrefix(taskName, NamespaceSeparator)
247+
if after, ok := strings.CutPrefix(taskName, NamespaceSeparator); ok {
248+
return after
249249
}
250250
return fmt.Sprintf("%s%s%s", namespace, NamespaceSeparator, taskName)
251251
}

watch.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ func (e *Executor) watchTasks(calls ...*Call) error {
3636

3737
ctx, cancel := context.WithCancel(context.Background())
3838
for _, c := range calls {
39-
c := c
4039
go func() {
4140
err := e.RunTask(ctx, c)
4241
if err == nil {
@@ -85,7 +84,6 @@ func (e *Executor) watchTasks(calls ...*Call) error {
8584
e.Compiler.ResetCache()
8685

8786
for _, c := range calls {
88-
c := c
8987
go func() {
9088
if ShouldIgnore(event.Name) {
9189
e.Logger.VerboseErrf(logger.Magenta, "task: event skipped for being an ignored dir: %s\n", event.Name)

0 commit comments

Comments
 (0)