Skip to content

Target is launched which should not be launched #371

Open
@whiterm

Description

@whiterm

To reproduce this bug, it was necessary to run go run mage.go test4 several times, because this error is floating

// +build mage

package main

import (
	"fmt"

	"github.com/magefile/mage/mg"
)

func Test1() error {
	fmt.Println("execute test1")
	return fmt.Errorf("error test1")
}

func Test2() error {
	mg.Deps(Test1)
	fmt.Println("execute test2")
	return nil
}

func Test3() error {
	mg.Deps(Test2)
	fmt.Println("execute test3")
	return nil
}
func Test4() error {
	mg.Deps(Test1, Test2, Test3)
	fmt.Println("execute test4")
	return nil
}

Output:

execute test1
execute test3
Error: error test1
error test1
exit status 1

test3 target is not expected to run

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions