25 lines
379 B
Go
25 lines
379 B
Go
package env
|
|
|
|
import (
|
|
"log"
|
|
"os"
|
|
)
|
|
|
|
func GetRequired(name string) string {
|
|
value, exists := os.LookupEnv(name)
|
|
if !exists {
|
|
log.Fatal("Environment variable not set: ", name)
|
|
}
|
|
|
|
return value
|
|
}
|
|
|
|
func Get(name string) string {
|
|
value, exists := os.LookupEnv(name)
|
|
if !exists {
|
|
log.Print("Environment variable not set: ", name)
|
|
}
|
|
|
|
return value
|
|
}
|