// Package godebug is a minimal shim for the GOROOT-private internal/godebug, // providing just the Setting API that the vendored crypto/tls uses.
package godebug import // Setting is a GODEBUG setting. type Setting struct{ name string } // New returns the Setting for the given GODEBUG key. func ( string) *Setting { return &Setting{name: } } // Value returns the value of the setting from the GODEBUG environment variable, // or "" if unset. This is sufficient for crypto/tls's default-path checks. func ( *Setting) () string { := os.Getenv("GODEBUG") for != "" { var string if := indexByte(, ','); >= 0 { , = [:], [+1:] } else { , = , "" } if := indexByte(, '='); >= 0 && [:] == .name { return [+1:] } } return "" } // IncNonDefault is a no-op (metrics-only in the original). func ( *Setting) () {} func indexByte( string, byte) int { for := 0; < len(); ++ { if [] == { return } } return -1 }