DEV Community

Ivan Jijon
Ivan Jijon

Posted on

1

How to configure Delve (dlv) in VS Code

Let's have Delve integrated with VS Code!

First you need to install Delve (dlv):

go install github.com/go-delve/delve/cmd/dlv@latest
Enter fullscreen mode Exit fullscreen mode

You can verify where it was installed by running:

which dlv
Enter fullscreen mode Exit fullscreen mode

Then in Visual Studio Code you need to go to Settings and search "delve". You will find Go: Delve Config.

Image description

Click on "Edit in settings.json".

Add the path to dlv you obtained before:

"go.delveConfig": {
    "dlvPath":"/Users/<user>/go/bin/dlv"
}
Enter fullscreen mode Exit fullscreen mode

Finally, in the launch.json file add the configuration for launching the debugger.

Adapt "program" and "envFile" to point to the values needed in your project.

Here an example:

"configurations": [
    {
        "name":"Launch",
        "type": "go",
        "request": "launch",
        "mode": "debug",
        "program": "${workspaceFolder}/.../main.go",
        "envFile": "${workspaceFolder}/.../.env"
    }
]
Enter fullscreen mode Exit fullscreen mode

You can now run in debug mode your program by pressing F5 key.

I hope you will find this setup helpful.

Image of Timescale

🚀 pgai Vectorizer: SQLAlchemy and LiteLLM Make Vector Search Simple

We built pgai Vectorizer to simplify embedding management for AI applications—without needing a separate database or complex infrastructure. Since launch, developers have created over 3,000 vectorizers on Timescale Cloud, with many more self-hosted.

Read full post →

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Dive into an ocean of knowledge with this thought-provoking post, revered deeply within the supportive DEV Community. Developers of all levels are welcome to join and enhance our collective intelligence.

Saying a simple "thank you" can brighten someone's day. Share your gratitude in the comments below!

On DEV, sharing ideas eases our path and fortifies our community connections. Found this helpful? Sending a quick thanks to the author can be profoundly valued.

Okay