delve/_fixtures/testenv.go
Hyang-Ah Hana Kim 21bdb466f1
dap: support 'Env' attribute for launch requests (#2846)
* dap: support 'Env' attribute for launch requests

Env is applied in addition to the delve process environment
variables. The env setting is done by calling os.Setenv
as early as possible when a Launch request is received.

Prior discussion is in https://github.com/go-delve/delve/pull/2582

In Visual Studio Code, setting null for an environment variable
in launch.json or tasks.json indicates users want to unset
the environment variable. Support the behavior by accepting
nil value.

* dap: Env field itself can be omitempty

* edit comment
2022-01-06 09:01:09 -08:00

14 lines
157 B
Go

package main
import (
"fmt"
"os"
"runtime"
)
func main() {
x, y := os.LookupEnv("SOMEVAR")
runtime.Breakpoint()
fmt.Printf("SOMEVAR=%s\n%v", x, y)
}