Skip to content

Latest commit

 

History

History
58 lines (51 loc) · 1.08 KB

README.md

File metadata and controls

58 lines (51 loc) · 1.08 KB

go-debug

Debugging golang code on docker container with VSCode (delve)

Requirements

Instalation

Clone

Cloning go-debug repository.

clone https://github.com/ammorteza/go-debug.git

Configure debugging with VSCode

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Launch",
            "type": "go",
            "request": "attach",
            "mode": "remote",
            "remotePath": "/app",
            "port": 2345,
            "showLog": true,
            "trace": "verbose"
          }
    ]
}

Build

Build and run go-debug services with Docker Compose.

docker-compose up

After running docker compose up, make sure all containers run correctly.

Running

API Endpoint

Send request in development mode.

http://localhost:8090/rest/user

{
	"user" : "Morteza Amzajerdi"
}

Send request in debugging mode.

http://localhost:9999/rest/user

{
	"user" : "Morteza Amzajerdi"
}