aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/runtime/env_windows.go
blob: d4ef13f9135d47931cdb47f00bbdd5ff6bab165e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
//go:build windows

package runtime

// Set environment variable in Windows:
//
//	BOOL SetEnvironmentVariableA(
//	    [in]           LPCSTR lpName,
//	    [in, optional] LPCSTR lpValue
//	);
//
//export SetEnvironmentVariableA
func _SetEnvironmentVariableA(key, val *byte) bool

func setenv(key, val *byte) {
	// ignore any errors
	_SetEnvironmentVariableA(key, val)
}

func unsetenv(key *byte) {
	// ignore any errors
	_SetEnvironmentVariableA(key, nil)
}