What is the correct posture for golang development api, to debug the program?

use golang to develop the gin framework for backend api,. Now every time you finish writing an interface, you need to run go build xxx to perform a compilation, then execute the compiled binary file, and then debug the interface. There is a problem in the middle. After changing it, you have to repeat the above steps. It feels very tedious. Is my development method wrong? Or is there any debugging tool that can automatically compile and run commands according to code changes, so that after code changes, you can use the postman request interface to see the effect of the changes immediately?

New:
in docker, after running bee run with the bee tool, it remains in the lower interface, and code changes will not recompile

.

clipboard.png

The gadgets provided by

bee run
https://beego.me/docs/install.
beego are not intrusive. Change the code, save will be automatically edited, start, very convenient.


didn't you write the unit test for go? Just name it xx_test.go.


codegangsta/gin

basic usage

Menu