mirror of
https://github.com/yusing/godoxy.git
synced 2026-03-27 03:21:09 +01:00
v0.5.0-rc5: added proxy.exclude label, refactored some code
This commit is contained in:
@@ -2,17 +2,13 @@ package common
|
||||
|
||||
import (
|
||||
"os"
|
||||
"strings"
|
||||
|
||||
U "github.com/yusing/go-proxy/utils"
|
||||
)
|
||||
|
||||
var NoSchemaValidation = getEnvBool("GOPROXY_NO_SCHEMA_VALIDATION")
|
||||
var IsDebug = getEnvBool("GOPROXY_DEBUG")
|
||||
|
||||
func getEnvBool(key string) bool {
|
||||
switch strings.ToLower(os.Getenv(key)) {
|
||||
case "1", "true", "yes", "on":
|
||||
return true
|
||||
default:
|
||||
return false
|
||||
}
|
||||
return U.ParseBool(os.Getenv(key))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user