1
0
mirror of https://github.com/magefile/mage.git synced 2026-10-28 19:17:25 +03:00
Files
mage/parse/testdata/command.go
James S df367221b6 context for jobs (#32)
Allows for jobs that take and call with a context.  Closes #25
2017-10-17 23:57:04 -04:00

33 lines
495 B
Go

// +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 = ReturnsError
// 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
}