identity-service/internal/app/config/env.go

23 lines
256 B
Go
Raw Normal View History

2022-06-19 15:19:05 +02:00
package config
import (
"os"
"github.com/joho/godotenv"
)
var ErrLoadingEnvs error
func init() {
ErrLoadingEnvs = godotenv.Load()
}
func GetEnv(name, defVal string) string {
env := os.Getenv(name)
if env == "" {
return defVal
}
return env
}