1
2
3
4
5
6
7
8 package godebugs
9
10
11 type Info struct {
12 Name string
13 Package string
14 Changed int
15 Old string
16 Opaque bool
17 }
18
19
20
21
22
23
24
25
26
27 var All = []Info{
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: "gotypesalias", Package: "go/types"},
33 {Name: "http2client", Package: "net/http"},
34 {Name: "http2debug", Package: "net/http", Opaque: true},
35 {Name: "http2server", Package: "net/http"},
36 {Name: "httplaxcontentlength", Package: "net/http", Changed: 22, Old: "1"},
37 {Name: "httpmuxgo121", Package: "net/http", Changed: 22, Old: "1"},
38 {Name: "installgoroot", Package: "go/build"},
39 {Name: "jstmpllitinterp", Package: "html/template"},
40
41 {Name: "multipartmaxheaders", Package: "mime/multipart"},
42 {Name: "multipartmaxparts", Package: "mime/multipart"},
43 {Name: "multipathtcp", Package: "net"},
44 {Name: "netdns", Package: "net", Opaque: true},
45 {Name: "netedns0", Package: "net", Changed: 19, Old: "0"},
46 {Name: "panicnil", Package: "runtime", Changed: 21, Old: "1"},
47 {Name: "randautoseed", Package: "math/rand"},
48 {Name: "tarinsecurepath", Package: "archive/tar"},
49 {Name: "tls10server", Package: "crypto/tls", Changed: 22, Old: "1"},
50 {Name: "tlsmaxrsasize", Package: "crypto/tls"},
51 {Name: "tlsrsakex", Package: "crypto/tls", Changed: 22, Old: "1"},
52 {Name: "tlsunsafeekm", Package: "crypto/tls", Changed: 22, Old: "1"},
53 {Name: "x509sha1", Package: "crypto/x509"},
54 {Name: "x509usefallbackroots", Package: "crypto/x509"},
55 {Name: "x509usepolicies", Package: "crypto/x509"},
56 {Name: "zipinsecurepath", Package: "archive/zip"},
57 }
58
59
60 func Lookup(name string) *Info {
61
62 lo := 0
63 hi := len(All)
64 for lo < hi {
65 m := int(uint(lo+hi) >> 1)
66 mid := All[m].Name
67 if name == mid {
68 return &All[m]
69 }
70 if name < mid {
71 hi = m
72 } else {
73 lo = m + 1
74 }
75 }
76 return nil
77 }
78
View as plain text