"go.buildFlags": [ "--ldflags -r=${workspaceRoot}/lib"// works for 'debug test' but not 'run test' // "-ldflags=-r ${workspaceRoot}/lib" // works for 'run test' but not 'debug test' ], "go.buildTags": "linux", "gopls": { "build.buildFlags": [ "-tags=linux", ] }
{ // Use IntelliSense to learn about possible attributes. // Hover to view descriptions of existing attributes. // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 "version": "0.2.0", "configurations": [ // exec: debug a precompiled binary // The binary must be built with go build -gcflags=all="-N -l" to disable inlining and optimizations that can interfere with debugging. { "name": "UC:Debug", "type": "go", "request": "launch", "mode": "exec", "asRoot": true, "program": "${workspaceRoot}/program", "console": "integratedTerminal", "preLaunchTask": "go: build (debug)" }, ] }