https://github.com/ammorteza/go-debug
Debugging golang code on docker container with VSCode (Delve)
https://github.com/ammorteza/go-debug
debugging delve docker docker-compose gin golang vscode
Last synced: about 1 month ago
JSON representation
Debugging golang code on docker container with VSCode (Delve)
- Host: GitHub
- URL: https://github.com/ammorteza/go-debug
- Owner: ammorteza
- Created: 2020-10-18T10:52:11.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2020-10-18T11:32:35.000Z (over 5 years ago)
- Last Synced: 2025-02-15T02:15:30.714Z (over 1 year ago)
- Topics: debugging, delve, docker, docker-compose, gin, golang, vscode
- Language: Go
- Homepage:
- Size: 5.86 KB
- Stars: 2
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# go-debug
Debugging golang code on docker container with VSCode (delve)
## Requirements
- [Docker](https://docs.docker.com/get-docker/)
- [Docker Compose](https://docs.docker.com/compose/install/)
## Instalation
### Clone
Cloning go-debug repository.
```shell
clone https://github.com/ammorteza/go-debug.git
```
### Configure debugging with VSCode
```json
{
"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.
```shell
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
```json
{
"user" : "Morteza Amzajerdi"
}
```
Send request in debugging mode.
> http://localhost:9999/rest/user
```json
{
"user" : "Morteza Amzajerdi"
}
```