go-env icon indicating copy to clipboard operation
go-env copied to clipboard

`Marshal()` includes `"default="` tags in `EnvSet` output

Open fg-j opened this issue 3 years ago • 1 comments

I'm interested in using env.Marshal() to facilitate logging the environment variables that are set in build configuration for several Paketo Buildpacks.

We'd like to use the default= tag on some of our configuration struct fields. But when I iterate over the output of env.Marshal(&myStruct) to log the values of the environment variables, I see that the tags default=* are included as keys in the EnvSet.

See this Go playground for an example of what I mean.

fg-j avatar Jul 29 '22 14:07 fg-j

@jimmykodes can you help with this?

hinshun avatar Jul 29 '22 15:07 hinshun