在文件更改时自动重新编译并重新加载服务器
我知道AppEngine可以做到这一点,但是我没有为此编写代码.
I know AppEngine does this, but I'm not coding for it.
我尝试使用Ruby world中的Guard
来监听.go
文件上的更改,并执行以下命令:
I tried using Guard
from Ruby world, to listen on changes on .go
files, and execute the following commands:
killall foo
go build -race
./foo &
但是它永远不会将foo
发送到后台,只是无限期地挂起.
But it never sends foo
into background, it just hangs indefinitely.
你们如何解决这个问题?解决方案也必须跨平台(GNU/Linux和Mac).
How are you guys solving this problem? Solution has to be cross-platform too (GNU/Linux and Mac).
一个朋友为go编写了一个简单的Compile Daemon,对我自己的小型net/http-projects来说就像一个魅力.
A friend wrote a simple Compile Daemon for go, worked like a charm for my own small net/http-projects.
您可以在此处找到存储库: https://github.com/githubnemo/CompileDaemon
You can find the repository here: https://github.com/githubnemo/CompileDaemon