1
0

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

This commit is contained in:
2025-01-10 16:57:23 +01:00
parent bccd5c1ec6
commit 45ef1f3ddf
14 changed files with 88 additions and 51 deletions

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
}
}