aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/runtime1.go
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2022-10-17 15:34:50 -0400
committerGopher Robot <gobot@golang.org>2022-10-18 14:49:44 +0000
commit8dc08394f0d5f83523080e4dd99fded26b7c1ceb (patch)
tree06dc72d439c842aea68df4834e1310ac207fade7 /src/runtime/runtime1.go
parent9fedc481ea09a0539cd2669312429ef5416a8949 (diff)
downloadgo-8dc08394f0d5f83523080e4dd99fded26b7c1ceb.tar.xz
internal/godebug: remove dependency on os
The immediate reason is that we want to use godebug from math/rand, and math/rand importing godebug importing os causes an import cycle in package testing. More generally, the new approach to backward compatibility outlined in discussion #55090 will require using this package from other similarly sensitive places, perhaps even package os itself. Best to remove all dependencies. Preparation for #54880. Change-Id: Ia01657a2d90e707a8121a336c9db3b7247c0198f Reviewed-on: https://go-review.googlesource.com/c/go/+/439418 Auto-Submit: Russ Cox <rsc@golang.org> Run-TryBot: Russ Cox <rsc@golang.org> Reviewed-by: Austin Clements <austin@google.com> Reviewed-by: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org>
Diffstat (limited to 'src/runtime/runtime1.go')
-rw-r--r--src/runtime/runtime1.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/runtime/runtime1.go b/src/runtime/runtime1.go
index b0a458d187..a29608329c 100644
--- a/src/runtime/runtime1.go
+++ b/src/runtime/runtime1.go
@@ -355,6 +355,8 @@ var dbgvars = []dbgVar{
{"adaptivestackstart", &debug.adaptivestackstart},
}
+var globalGODEBUG string
+
func parsedebugvars() {
// defaults
debug.cgocheck = 1
@@ -372,7 +374,9 @@ func parsedebugvars() {
debug.madvdontneed = 1
}
- for p := gogetenv("GODEBUG"); p != ""; {
+ globalGODEBUG = gogetenv("GODEBUG")
+ godebugenv.StoreNoWB(&globalGODEBUG)
+ for p := globalGODEBUG; p != ""; {
field := ""
i := bytealg.IndexByteString(p, ',')
if i < 0 {