From abeb9e1a6bcabc26f92e112e736ae99ad461e40c Mon Sep 17 00:00:00 2001 From: ari melody Date: Fri, 24 Jul 2026 17:55:08 +0100 Subject: [PATCH] ditch dotenv --- utils/dotenv/dotenv.go | 36 ------------------------------------ 1 file changed, 36 deletions(-) delete mode 100644 utils/dotenv/dotenv.go diff --git a/utils/dotenv/dotenv.go b/utils/dotenv/dotenv.go deleted file mode 100644 index 4e9dbb6..0000000 --- a/utils/dotenv/dotenv.go +++ /dev/null @@ -1,36 +0,0 @@ -package dotenv - -import ( - "os" - "strings" -) - -func LoadEnv() (map[string]string, error) { - data, err := os.ReadFile(".env") - if err != nil { return nil, err } - - dataString := string(data) - lines := strings.Split(dataString, "\n") - - envars := map[string]string{} - for _, line := range lines { - splits := strings.Split(line, "=") - if len(splits) < 2 { continue } - - key := splits[0] - value := splits[1] - - if len(value) > 2 && value[0] == '"' && value[len(value) - 1] == '"' { - value = value[1:len(value)-1] - } - - envars[key] = value - } - - return envars, nil -} - -func SafeGet(m map[string]string, k string) string { - value, _ := m[k] - return value -}