[bugfix] Downstep otel to fix freebsd compile issue (#1773)

https://github.com/open-telemetry/opentelemetry-go/issues/4076
This commit is contained in:
tobi 2023-05-12 14:55:18 +02:00 committed by GitHub
commit b47661f033
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
70 changed files with 1097 additions and 3138 deletions

View file

@ -70,8 +70,8 @@ const (
// returned.
func firstInt(defaultValue int, keys ...string) int {
for _, key := range keys {
value := os.Getenv(key)
if value == "" {
value, ok := os.LookupEnv(key)
if !ok {
continue
}
@ -88,10 +88,10 @@ func firstInt(defaultValue int, keys ...string) int {
}
// IntEnvOr returns the int value of the environment variable with name key if
// it exists, it is not empty, and the value is an int. Otherwise, defaultValue is returned.
// it exists and the value is an int. Otherwise, defaultValue is returned.
func IntEnvOr(key string, defaultValue int) int {
value := os.Getenv(key)
if value == "" {
value, ok := os.LookupEnv(key)
if !ok {
return defaultValue
}