Skip to content

Latest commit

 

History

History
39 lines (30 loc) · 1006 Bytes

README.md

File metadata and controls

39 lines (30 loc) · 1006 Bytes

Go Debugging for Intellij GoLand

Example

Clone the repo

git clone https://github.com/hanrok/godebug.git

Build the micro-service example

docker build -t godebug .

Run the service

docker run --rm -v $PWD:/build -p8080:8080 -p40000:40000 godebug

You should see output like this:

Running server
API server listening at: [::]:40000
Delve PID: 8, Server PID: 17
Setting up watches.  Beware: since -r was given, this may take a while!
Watches established.

After you see this output, you need to create a new remote debug configuration in Goland (described in details in here).

Then run the debug (by click green beetle or Ctrl-D). Container output should now be with this line:

2020/03/05 20:13:32 Starting up repeater

Whenever you change your code (main.go file) it will rebuild the image and rerun the server.