Go Auto-Recompile and Reload Server on file change

后端 未结 9 908
清酒与你
清酒与你 2020-12-15 22:14

I know AppEngine does this, but I\'m not coding for it.

I tried using Guard from Ruby world, to listen on changes on .go files, and execut

9条回答
  •  执笔经年
    2020-12-15 23:01

    Another option, if you have nodejs installed on your machine

    install nodemon with -g npm i -g nodemon

    go to your code dir and run:

    nodemon --watch './**/*.go' --signal SIGTERM --exec 'go' run cmd/MyProgram/main.go
    

    This will send SIGTERM every time any .go files changes and will run go run cmd/Myprogram/main.go

    Fully cross platform.

提交回复
热议问题