First working version. Can add Projects and Tasks

This commit is contained in:
Anis Ahmad
2020-05-25 23:18:48 +06:00
parent 267995124b
commit 6f9580d98a
12 changed files with 610 additions and 0 deletions

34
util/env.go Normal file
View File

@@ -0,0 +1,34 @@
package util
import (
"log"
"os"
"strconv"
// "github.com/subosito/gotenv"
)
// func init() {
// gotenv.Load()
// }
func GetEnvInt(key string, defaultVal int) int {
if v, ok := os.LookupEnv(key); ok {
if i, err := strconv.Atoi(v); err == nil {
return i
} else {
log.Fatal(err)
}
return 0
}
return defaultVal
}
func GetEnvStr(key, defaultVal string) string {
if v, ok := os.LookupEnv(key); ok {
return v
}
return defaultVal
}