Golang

Problem

I had some trouble using go-sqlite3 while running tests in Visual Studio Code. The Go compiler didn’t adhere to the environment variables CC and CGO_ENABLED and the Go-extension.

Solution

Open the global settings.json using the Command Palette ctrl+ shift + P) and add:

"go.testEnvVars": {
  "CGO_ENABLED": "1",
  "CC": "x86_64-w64-mingw32-gcc.exe"
}