Closed reckless-huang closed 4 months ago
See the FAQ: https://www.kcl-lang.io/docs/user_docs/support/faq-kcl#37-how-to-modify-existing-configuration-blocks-in-kcl
The specific reason is that the envs
input from external sources uses a merge operator, which checks for conflicts. If you want to completely overwrite it, you can use a new envs and use the overwrite operator e.g. need_to_merge_envs={k=v for k, v in envs}
Note that I've used =
here.
magic
if _envs:
_dy_env = [{
name: k
value: v
} for k,v in _static_env_map | {k=v for k,v in _envs}]
else:
_dy_env = []
kclcode
go code
errors