Bumping k8s dependencies to 1.13
This commit is contained in:
41
vendor/golang.org/x/tools/godoc/env/env.go
generated
vendored
Normal file
41
vendor/golang.org/x/tools/godoc/env/env.go
generated
vendored
Normal file
@@ -0,0 +1,41 @@
|
||||
// Copyright 2018 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
// Package env provides environment information for the godoc server running on
|
||||
// golang.org.
|
||||
package env
|
||||
|
||||
import (
|
||||
"log"
|
||||
"os"
|
||||
"strconv"
|
||||
)
|
||||
|
||||
var (
|
||||
isProd = boolEnv("GODOC_PROD")
|
||||
enforceHosts = boolEnv("GODOC_ENFORCE_HOSTS")
|
||||
)
|
||||
|
||||
// IsProd reports whether the server is running in its production configuration
|
||||
// on golang.org.
|
||||
func IsProd() bool {
|
||||
return isProd
|
||||
}
|
||||
|
||||
// EnforceHosts reports whether host filtering should be enforced.
|
||||
func EnforceHosts() bool {
|
||||
return enforceHosts
|
||||
}
|
||||
|
||||
func boolEnv(key string) bool {
|
||||
v := os.Getenv(key)
|
||||
if v == "" {
|
||||
return false
|
||||
}
|
||||
b, err := strconv.ParseBool(v)
|
||||
if err != nil {
|
||||
log.Fatalf("environment variable %s (%q) must be a boolean", key, v)
|
||||
}
|
||||
return b
|
||||
}
|
Reference in New Issue
Block a user