Mainflux.mainflux/env.go

14 lines
238 B
Go

package mainflux
import "os"
// Env reads specified environment variable. If no value has been found,
// fallback is returned.
func Env(key, fallback string) string {
if v := os.Getenv(key); v != "" {
return v
}
return fallback
}