Closed rts-gordon closed 9 months ago
Hi there,
There are some environment variable defined like this:
[app] env = "dev" env.prefix = "TMT_"
the parse code:
ENV = koanf.New(".") if err := ENV.Load(file.Provider(configFile), toml.Parser()); err != nil { log.Fatalf("error loading config file: %v", err) }
This will occurs error:
error loading config file: (8, 1): Unknown table type for path: app.env
But if the variable change like this, the parse will pass.
[app] env.value = "dev" env.prefix = "TMT_"
My question is: why the 'env' and 'env.prefix' confict? they are two different variables.
Thank you.
Hi. That's invalid TOML. You can paste the snippet and validate it here.
https://www.toml-lint.com/
Can't redefine existing key at row 3, col 20, pos 38: 2: env = "dev" 3> env.prefix = "TMT_" ^
Hi there,
There are some environment variable defined like this:
the parse code:
This will occurs error:
But if the variable change like this, the parse will pass.
My question is: why the 'env' and 'env.prefix' confict? they are two different variables.
Thank you.