1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
|
// +build mage
package main
import (
"context"
"fmt"
"github.com/magefile/mage/mg"
)
// This should work as a default - even if it's in a different file
var Default = ReturnsNilError
// this should not be a target because it returns a string
func ReturnsString() string {
fmt.Println("more stuff")
return ""
}
func ReturnsVoid() {
mg.Deps(f)
}
func f() {}
func TakesContextReturnsVoid(ctx context.Context) {
}
func TakesContextReturnsError(ctx context.Context) error {
return nil
}
|