mergemap
mergemap copied to clipboard
Add support for: WithMaxDepth, WithAppendSlice, WithKeyStringer
Can you say a bit more why you want these changes? AppendSlice makes sense, but why the others?
I was trying to use the library with maps returned from YAML unmarshal. Most use cases arose from there.
- WithMaxDepth: Needed control over depth of nested key-value maps in YAML
- WithKeyStringer: In case of a
nil
map key, reflect would return "nil" string. My use case required it to be "null". Example.
I do understand that these might not be super-relevant for the library. Feel free to ignore the PR.
Yeah, I'll probably add the MaxDepth option, and might add the AppendSlice option, but I think the KeyStringer bit is out of scope.