Fix private URL var name, add helper for retrieving various environment variables

This commit is contained in:
2023-12-24 22:07:44 -06:00
parent 37604e1eeb
commit 7e762ff2aa
2 changed files with 16 additions and 10 deletions

View File

@@ -5,6 +5,7 @@ import (
"io"
"math/rand"
"net/http"
"os"
"runtime"
"strconv"
"strings"
@@ -177,3 +178,12 @@ func (nt NaiveTime) String() string {
}
return fmt.Sprintf("%d:%02d%s", hour, nt.Minutes, meridiem)
}
func GetFirstEnv(key ...string) string {
for _, k := range key {
if v := os.Getenv(k); v != "" {
return v
}
}
return ""
}