1 // Copyright 2023 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.
5 // Package godebugs provides a table of known GODEBUG settings,
6 // for use by a variety of other packages, including internal/godebug,
7 // runtime, runtime/metrics, and cmd/go/internal/load.
10 // An Info describes a single known GODEBUG setting.
12 Name string // name of the setting ("panicnil")
13 Package string // package that uses the setting ("runtime")
14 Changed int // minor version when default changed, if any; 21 means Go 1.21
15 Old string // value that restores behavior prior to Changed
16 Opaque bool // setting does not export information to runtime/metrics using [internal/godebug.Setting.IncNonDefault]
19 // All is the table of known settings, sorted by Name.
21 // Note: After adding entries to this table, run 'go generate runtime/metrics'
22 // to update the runtime/metrics doc comment.
23 // (Otherwise the runtime/metrics test will fail.)
25 // Note: After adding entries to this table, update the list in doc/godebug.md as well.
26 // (Otherwise the test in this package will fail.)
28 {Name: "execerrdot", Package: "os/exec"},
29 {Name: "gocachehash", Package: "cmd/go"},
30 {Name: "gocachetest", Package: "cmd/go"},
31 {Name: "gocacheverify", Package: "cmd/go"},
32 {Name: "http2client", Package: "net/http"},
33 {Name: "http2debug", Package: "net/http", Opaque: true},
34 {Name: "http2server", Package: "net/http"},
35 {Name: "installgoroot", Package: "go/build"},
36 {Name: "jstmpllitinterp", Package: "html/template"},
37 //{Name: "multipartfiles", Package: "mime/multipart"},
38 {Name: "multipartmaxheaders", Package: "mime/multipart"},
39 {Name: "multipartmaxparts", Package: "mime/multipart"},
40 {Name: "multipathtcp", Package: "net"},
41 {Name: "netdns", Package: "net", Opaque: true},
42 {Name: "panicnil", Package: "runtime", Changed: 21, Old: "1"},
43 {Name: "randautoseed", Package: "math/rand"},
44 {Name: "tarinsecurepath", Package: "archive/tar"},
45 {Name: "x509sha1", Package: "crypto/x509"},
46 {Name: "x509usefallbackroots", Package: "crypto/x509"},
47 {Name: "zipinsecurepath", Package: "archive/zip"},
50 // Lookup returns the Info with the given name.
51 func Lookup(name string) *Info {
52 // binary search, avoiding import of sort.