move unit related constant to common lib
This commit is contained in:
@@ -7,8 +7,6 @@ import (
|
||||
"strings"
|
||||
)
|
||||
|
||||
const MiB = 1024 * 1024
|
||||
|
||||
type Config struct {
|
||||
ListenPort int `json:"listenPort"`
|
||||
PVE struct {
|
||||
@@ -65,11 +63,3 @@ func AnyPrefixes(s string, prefixes []string) string {
|
||||
|
||||
return ""
|
||||
}
|
||||
|
||||
func SafeUint64(i int) uint64 {
|
||||
if i < 0 {
|
||||
log.Printf("Tried to cast %d to uint64", i)
|
||||
return 0
|
||||
}
|
||||
return uint64(i)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user