Skip to content

Instantly share code, notes, and snippets.

@Integralist
Last active August 29, 2015 14:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Integralist/610fa74263818333700c to your computer and use it in GitHub Desktop.
Save Integralist/610fa74263818333700c to your computer and use it in GitHub Desktop.
Godo re-build task
// 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)
}
@Integralist
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment