fix(backend): added extra checks in config file parser

This commit is contained in:
Alexander Zavorotynskiy 2022-11-02 12:35:22 +01:00
parent f6b1e0a027
commit 177b2ee9c4

View file

@ -30,7 +30,13 @@ func readFile(path string) (map[string]string, error) {
res := make(map[string]string)
lines := strings.Split(string(data), "\n")
for _, line := range lines {
if len(line) == 0 {
continue
}
env := strings.Split(line, "=")
if len(env) < 2 {
continue
}
res[env[0]] = env[1]
}
return res, nil