Last active
August 29, 2015 14:28
-
-
Save Integralist/610fa74263818333700c to your computer and use it in GitHub Desktop.
Godo re-build task
This file contains hidden or 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
// It's important to realise that you'll only ever want to `go build` or `go run` a single file | |
// This confused me originally | |
// I could understand why my task's `Context` didn't get passed the name of the changed file | |
// The problem was I was just hacking little scripts together | |
// In practice, you'll be working within a project directory and you'll have a single entry point file | |
package main | |
import . "gopkg.in/godo.v1" | |
func tasks(p *Project) { | |
p.Task("build", func(c *Context) error { | |
return Run("go build") | |
}).Watch("**/*.go") | |
} | |
func main() { | |
Godo(tasks) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://github.com/go-godo/godo