- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 40 for unsetEnv (0.19 sec)
-
test/fixedbugs/issue36705.go
os.Setenv("FOO", "bar") s := C.GoString(C.getenv(C.CString("FOO"))) if s != "bar" { panic("bad setenv, environment variable only has value \"" + s + "\"") } os.Unsetenv("FOO") s = C.GoString(C.getenv(C.CString("FOO"))) if s != "" { panic("bad unsetenv, environment variable still has value \"" + s + "\"") }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu Oct 19 23:33:25 UTC 2023 - 649 bytes - Viewed (0) -
src/cmd/vendor/golang.org/x/sys/unix/env_unix.go
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu Oct 19 23:33:33 UTC 2023 - 645 bytes - Viewed (0) -
src/runtime/cgo/gcc_setenv.c
/* Stub for calling setenv */ void x_cgo_setenv(char **arg) { _cgo_tsan_acquire(); setenv(arg[0], arg[1], 1); _cgo_tsan_release(); } /* Stub for calling unsetenv */ void x_cgo_unsetenv(char **arg) { _cgo_tsan_acquire(); unsetenv(arg[0]); _cgo_tsan_release();
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Tue Jan 24 22:38:02 UTC 2023 - 487 bytes - Viewed (0) -
src/cmd/vendor/golang.org/x/sys/windows/env_windows.go
env = append(env, UTF16ToString(entry)) block = (*uint16)(unsafe.Add(end, size)) } return env, nil } func Unsetenv(key string) error { return syscall.Unsetenv(key)
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu Feb 08 20:35:26 UTC 2024 - 1.3K bytes - Viewed (0) -
src/cmd/dist/exec.go
} } // setEnv sets cmd.Env so that key = value. func setEnv(cmd *exec.Cmd, key, value string) { cmd.Env = append(cmd.Environ(), key+"="+value) } // unsetEnv sets cmd.Env so that key is not present in the environment. func unsetEnv(cmd *exec.Cmd, key string) { cmd.Env = cmd.Environ() prefix := key + "=" newEnv := []string{} for _, entry := range cmd.Env { if strings.HasPrefix(entry, prefix) {
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu Jul 20 21:52:09 UTC 2023 - 957 bytes - Viewed (0) -
src/os/env_test.go
} if err := Setenv(testKey, "1"); err != nil { t.Fatalf("Setenv: %v", err) } if !set() { t.Error("Setenv didn't set TestUnsetenv") } if err := Unsetenv(testKey); err != nil { t.Fatalf("Unsetenv: %v", err) } if set() { t.Fatal("Unsetenv didn't clear TestUnsetenv") } } func TestClearenv(t *testing.T) { const testKey = "GO_TEST_CLEARENV" const testValue = "1" // reset env
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Tue Jul 04 15:31:54 UTC 2023 - 5K bytes - Viewed (0) -
src/syscall/env_windows.go
} keyp, err := UTF16PtrFromString(key) if err != nil { return err } e := SetEnvironmentVariable(keyp, v) if e != nil { return e } runtimeSetenv(key, value) return nil } func Unsetenv(key string) error { keyp, err := UTF16PtrFromString(key) if err != nil { return err } e := SetEnvironmentVariable(keyp, nil) if e != nil { return e } runtimeUnsetenv(key) return nil }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Tue Jul 04 15:31:54 UTC 2023 - 2K bytes - Viewed (0) -
src/os/env.go
func Setenv(key, value string) error { err := syscall.Setenv(key, value) if err != nil { return NewSyscallError("setenv", err) } return nil } // Unsetenv unsets a single environment variable. func Unsetenv(key string) error { return syscall.Unsetenv(key) } // Clearenv deletes all environment variables. func Clearenv() { syscall.Clearenv() }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Mon Feb 26 21:33:12 UTC 2024 - 3.9K bytes - Viewed (0) -
src/time/zoneinfo_unix_test.go
//go:build unix && !ios && !android package time_test import ( "os" "testing" "time" ) func TestEnvTZUsage(t *testing.T) { const env = "TZ" tz, ok := os.LookupEnv(env) if !ok { defer os.Unsetenv(env) } else { defer os.Setenv(env, tz) } defer time.ForceUSPacificForTesting() localZoneName := "Local" // The file may not exist. if _, err := os.Stat("/etc/localtime"); os.IsNotExist(err) {
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Tue Mar 29 16:24:51 UTC 2022 - 2.3K bytes - Viewed (0) -
cmd/update_test.go
} if !strings.Contains(str, expectedStr) { t.Errorf("Test %d: expected: %s, got: %s", i+1, expectedStr, str) } globalIsCICD = sci os.Unsetenv("MARATHON_APP_LABEL_DCOS_PACKAGE_VERSION") os.Unsetenv(testCase.envName) } } // Tests if the environment we are running is in DCOS. func TestIsDCOS(t *testing.T) { sci := globalIsCICD globalIsCICD = false defer func() {
Registered: Sun Jun 16 00:44:34 UTC 2024 - Last Modified: Sat Mar 09 03:07:08 UTC 2024 - 10.7K bytes - Viewed (0)