-
Notifications
You must be signed in to change notification settings - Fork 257
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Persist the fact that a dependency might have failed and replay it each
time (*onceFun).run is invoked. Fixes #371.
- Loading branch information
1 parent
d9e2e41
commit 14708d6
Showing
3 changed files
with
99 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
// +build mage | ||
|
||
package main | ||
|
||
import ( | ||
"fmt" | ||
"time" | ||
|
||
"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 { | ||
time.Sleep(time.Second) | ||
mg.Deps(Test2) | ||
fmt.Println("execute test3") | ||
return nil | ||
} | ||
func Test4() error { | ||
mg.Deps(Test1, Test2, Test3) | ||
fmt.Println("execute test4") | ||
return nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters