mirror of
https://github.com/minio/minio.git
synced 2025-11-21 18:26:04 -05:00
Refactor config and split them in packages (#8351)
This change is related to larger config migration PR change, this is a first stage change to move our configs to `cmd/config/` - divided into its subsystems
This commit is contained in:
committed by
kannappanr
parent
74008446fe
commit
589e32a4ed
21
pkg/env/env.go
vendored
Normal file
21
pkg/env/env.go
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
package env
|
||||
|
||||
import "os"
|
||||
|
||||
// Get retrieves the value of the environment variable named
|
||||
// by the key. If the variable is present in the environment the
|
||||
// value (which may be empty) is returned. Otherwise it returns
|
||||
// the specified default value.
|
||||
func Get(key, defaultValue string) string {
|
||||
if v, ok := os.LookupEnv(key); ok {
|
||||
return v
|
||||
}
|
||||
return defaultValue
|
||||
}
|
||||
|
||||
// Lookup retrieves the value of the environment variable named
|
||||
// by the key. If the variable is present in the environment the
|
||||
// value (which may be empty) is returned and the boolean is true.
|
||||
// Otherwise the returned value will be empty and the boolean will
|
||||
// be false.
|
||||
func Lookup(key string) (string, bool) { return os.LookupEnv(key) }
|
||||
Reference in New Issue
Block a user