mirror of
https://codeberg.org/Codeberg/pages-server.git
synced 2025-04-25 14:26:58 +00:00
remove EnvOr use flags
This commit is contained in:
parent
ac93a5661c
commit
35e08d2252
5 changed files with 93 additions and 61 deletions
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue