21
0
Fork 0
This commit is contained in:
Mike Schwörer 2023-03-11 14:38:19 +01:00
parent ee325f67fd
commit 62acddda5e
Signed by: Mikescher
GPG Key ID: D3C7172E0A70F8CF
1 changed files with 2 additions and 2 deletions

View File

@ -22,10 +22,10 @@ import (
//
// sub-structs are recursively parsed (if they have an env tag) and the env-variable keys are delimited by the delim parameter
// sub-structs with `env:""` are also parsed, but the delimited is skipped (they are handled as if they were one level higher)
func ApplyEnvOverrides[T any](c *T, delim string) error {
func ApplyEnvOverrides[T any](prefix string, c *T, delim string) error {
rval := reflect.ValueOf(c).Elem()
return processEnvOverrides(rval, delim, "")
return processEnvOverrides(rval, delim, prefix)
}
func processEnvOverrides(rval reflect.Value, delim string, prefix string) error {