Skip to content

Instantly share code, notes, and snippets.

@sathishvj
Created January 3, 2017 11:51
Show Gist options
  • Save sathishvj/1799782c443448784325138db2655dfd to your computer and use it in GitHub Desktop.
Save sathishvj/1799782c443448784325138db2655dfd to your computer and use it in GitHub Desktop.
godo for go web server project
package main
import do "gopkg.in/godo.v2"
func tasks(p *do.Project) {
// put your go path configuration as appropriate
// do.Env = `GOPATH=.vendor::$GOPATH`
// do.Env = `GOPATH=$GOPATH`
// do.Env = `GOPATH=/Users/me/projects/abcd/dev/gocode::/Users/me/go/gopath`
p.Task("default", do.S{"gobuild"}, nil)
p.Task("gobuild", do.S{}, func(c *do.Context) {
c.Run(`go build -o out`)
c.Start(`./out`) // my project is a web app. c.Start will stop listening server and restart it.
}).Src(`**/*.{go}`).Debounce(10000)
}
func main() {
do.Godo(tasks)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment