remove EnvOr use flags

This commit is contained in:
6543
2021-12-03 03:05:38 +01:00
parent ac93a5661c
commit 35e08d2252
5 changed files with 93 additions and 61 deletions

View File

@ -3,8 +3,6 @@ package server
import (
"bytes"
"encoding/gob"
"os"
"github.com/akrylysov/pogreb"
)
@ -56,12 +54,3 @@ func PogrebGet(db *pogreb.DB, name []byte, obj interface{}) bool {
}
return true
}
// EnvOr reads an environment variable and returns a default value if it's empty.
// TODO: to helpers.go or use CLI framework
func EnvOr(env string, or string) string {
if v := os.Getenv(env); v != "" {
return v
}
return or
}