「🏗️」 wip: work in progress, not done yet.

This commit is contained in:
KeyZox committed 2025-01-10 16:57:23 +01:00
1 parent bccd5c1ec6
commit 45ef1f3ddf
14 files changed
+88 -51

No files matched your search

+11
View File
@@ -2,6 +2,7 @@ package env
import (
"os"
"strings"
"git.keyzox.me/42_adjoly/inception/internal/log"
)
@@ -32,3 +33,13 @@ func EnvCheck(Value, Default string) string {
}
return Default
}
func EscapeEnv(str string) string {
if str[0] == '"' && str[len(str) - 1] == '"' {
return strings.TrimPrefix(strings.TrimSuffix(str, "\""), "\"")
} else if str[0] == '"' && str[len(str) - 1] == '"' {
return strings.TrimPrefix(strings.TrimSuffix(str, "'"), "'")
} else {
return str
}
}