mergemap icon indicating copy to clipboard operation
mergemap copied to clipboard

Add support for: WithMaxDepth, WithAppendSlice, WithKeyStringer

Open shivamMg opened this issue 5 years ago • 3 comments

shivamMg avatar Jun 18 '19 09:06 shivamMg

Can you say a bit more why you want these changes? AppendSlice makes sense, but why the others?

peterbourgon avatar May 23 '22 00:05 peterbourgon

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.

shivamMg avatar May 24 '22 06:05 shivamMg

Yeah, I'll probably add the MaxDepth option, and might add the AppendSlice option, but I think the KeyStringer bit is out of scope.

peterbourgon avatar May 24 '22 09:05 peterbourgon