Source file src/runtime/runtime_noclearenv.go
1 // Copyright 2025 The Go Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style 3 // license that can be found in the LICENSE file. 4 5 //go:build !linux 6 7 package runtime 8 9 import _ "unsafe" // for go:linkname 10 11 //go:linkname syscall_runtimeClearenv syscall.runtimeClearenv 12 func syscall_runtimeClearenv(env map[string]int) { 13 // The system doesn't have clearenv(3) so emulate it by unsetting all of 14 // the variables manually. 15 for k := range env { 16 syscall_runtimeUnsetenv(k) 17 } 18 } 19