Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to pass boolean argument to delve in VS Code?

I am trying to pass argument to delve through VS Code but it doesn't work.

This is how to pass argument to a go program through delve:

dlv debug github.com/docker/swarm -- create

I tried many different solution in my launch.json:

"args": [
    "--",
    "create"
]
"args": [
    "--create"
]
"args": [
    "create"
]
like image 777
horex Avatar asked Oct 17 '18 09:10

horex


People also ask

How do you pass command line arguments in Visual Studio Code?

To set command-line arguments in Visual Studio, right click on the project name, then go to Properties. In the Properties Pane, go to "Debugging", and in this pane is a line for "Command-line arguments." Add the values you would like to use on this line. They will be passed to the program via the argv array.

How do you evaluate expressions in Vscode?

Expressions can be evaluated with the Debug Console REPL (Read-Eval-Print Loop) feature. To open the Debug Console, use the Debug Console action at the top of the Debug pane or use the View: Debug Console command (Ctrl+Shift+Y).

How do I run a json file in Visual Studio Code?

In Visual Studio Code, use shortcut Ctrl + Shift + P to open the Command Palette and type Open launch. json . And it will open the launch. json file for you.

What is launch json in Vscode?

A launch. json file is used to configure the debugger in Visual Studio Code. Visual Studio Code generates a launch. json (under a . vscode folder in your project) with almost all of the required information.


1 Answers

After many attempts, I found the right one:

"args": [
    "--create",
    "true"
]
like image 142
horex Avatar answered Oct 08 '22 02:10

horex