1
0
mirror of https://github.com/go-task/task.git synced 2025-11-23 22:24:45 +02:00

chore: run modernize

This commit is contained in:
Andrey Nering
2025-11-22 17:30:30 -03:00
parent 3ed403b839
commit c7b4f26900
3 changed files with 2 additions and 6 deletions

View File

@@ -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 {

View File

@@ -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)
}

View File

@@ -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)