MCPcopy Create free account
hub / github.com/imroc/req / Value

Method Value

internal/godebug/godebug.go:136–148  ·  view source on GitHub ↗

Value returns the current value for the GODEBUG setting s. Value maintains an internal cache that is synchronized with changes to the $GODEBUG environment variable, making Value efficient to call as frequently as needed. Clients should therefore typically not attempt their own caching of Value's re

()

Source from the content-addressed store, hash-verified

134// Clients should therefore typically not attempt their own
135// caching of Value's result.
136func (s *Setting) Value() string {
137 s.once.Do(func() {
138 s.setting = lookup(s.Name())
139 if s.info == nil && !s.Undocumented() {
140 panic("godebug: Value of name not listed in godebugs.All: " + s.name)
141 }
142 })
143 v := *s.value.Load()
144 if v.bisect != nil && !v.bisect.Stack(&stderr) {
145 return ""
146 }
147 return v.text
148}
149
150// lookup returns the unique *setting value for the given name.
151func lookup(name string) *setting {

Callers 8

StringMethod · 0.95
handleResponseBodyMethod · 0.45
logfMethod · 0.45
parseContentLengthFunction · 0.45
GetContextDataMethod · 0.45
GetDumpersFunction · 0.45
newIncNonDefaultFunction · 0.45
SetTracerMethod · 0.45

Calls 6

NameMethod · 0.95
UndocumentedMethod · 0.95
lookupFunction · 0.85
LoadMethod · 0.80
StackMethod · 0.80
DoMethod · 0.45

Tested by

no test coverage detected