12 lines
196 B
Go
12 lines
196 B
Go
|
package cli
|
||
|
|
||
|
import "os"
|
||
|
|
||
|
func SetDefaultValueFromEnv(value *string, key string, defaultValue string) {
|
||
|
if os.Getenv(key) != "" {
|
||
|
*value = os.Getenv(key)
|
||
|
} else {
|
||
|
*value = defaultValue
|
||
|
}
|
||
|
}
|