【1】热部署项目
gin在应用程序目录中运行,网络应用程序将 gin作为代理提供。gin检测到更改后,将自动重新编译代码
$ go get github.com/codegangsta/gin
# Then verify that gin was installed correctly:
$ gin -h
$ gin run main.go
Options:
--laddr value, -l value listening address for the proxy server
--port value, -p value port for the proxy server (default: 3000)
--appPort value, -a value port for the Go web server (default: 3001)
--bin value, -b value name of generated binary file (default: "gin-bin")
--path value, -t value Path to watch files from (default: ".")
--build value, -d value Path to build files from (defaults to same value as --path)
--excludeDir value, -x value Relative directories to exclude
--immediate, -i run the server immediately after it's built
--all reloads whenever any file changes, as opposed to reloading only on .go file change
--godep, -g use godep when building
--buildArgs value Additional go build arguments
--certFile value TLS Certificate
--keyFile value TLS Certificate Key
--logPrefix value Setup custom log prefix
--notifications enable desktop notifications
--help, -h show help
--version, -v print the version