简体   繁体   中英

How to set Go debug flag in vscode and know if you are running in debug

Do you know how to set debug flag in vscode, similar to this
Note: the question is stated "as in C#" and for Golang(Go code)

There is no "debug flag" for an editor. For most compiled languages, a debug flag will exist if you compiled the program in debug mode.

That link you posted is a different issue. Debugger.IsAttached for c# checks for the presence of the dotnet debugger, also has nothing to do with the editor.

Just use settings, and in my case writing go - you just set:

"go.buildTags": "delve",

And then follow the already mentioned accepted answer

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM