diff --git a/server/config.yaml b/server/config.yaml index 699a0cd..a292272 100644 --- a/server/config.yaml +++ b/server/config.yaml @@ -10,5 +10,5 @@ app: host: "47.97.27.195" port: "3306" user: "root" - password: "lansexiongdi," + password: "lansexiongdi6," name: "merketing" diff --git a/server/internal/config/env.go b/server/internal/config/env.go deleted file mode 100644 index cf4d2ac..0000000 --- a/server/internal/config/env.go +++ /dev/null @@ -1,45 +0,0 @@ -package config - -import ( - "bufio" - "os" - "path/filepath" - "strings" -) - -func LoadEnv() { - paths := []string{ - ".env.local", - filepath.Join("server", ".env.local"), - } - for _, p := range paths { - if loadFile(p) { - return - } - } -} - -func loadFile(path string) bool { - f, err := os.Open(path) - if err != nil { - return false - } - defer f.Close() - s := bufio.NewScanner(f) - for s.Scan() { - line := strings.TrimSpace(s.Text()) - if line == "" || strings.HasPrefix(line, "#") { - continue - } - idx := strings.Index(line, "=") - if idx <= 0 { - continue - } - k := strings.TrimSpace(line[:idx]) - v := strings.TrimSpace(line[idx+1:]) - if _, ok := os.LookupEnv(k); !ok || os.Getenv(k) == "" { - os.Setenv(k, v) - } - } - return true -}