1
0
mirror of https://github.com/lus/pasty.git synced 2023-08-10 21:13:09 +03:00

Fix some stuff

This commit is contained in:
Lukas Schulte Pelkum
2021-04-15 20:59:32 +02:00
parent 1792ef1c38
commit 681ee9f1d0
3 changed files with 29 additions and 30 deletions

6
internal/env/env.go vendored
View File

@@ -16,11 +16,11 @@ func Load() {
// MustString returns the content of the environment variable with the given key or the given fallback
func MustString(key, fallback string) string {
found := os.Getenv(static.EnvironmentVariablePrefix + key)
if found == "" {
value, found := os.LookupEnv(static.EnvironmentVariablePrefix + key)
if !found {
return fallback
}
return found
return value
}
// MustBool uses MustString and parses it into a boolean