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

Apply multiline tag to value instead of container for non-arrays

Open pelletier opened this issue 1 year ago • 0 comments

Discussed in https://github.com/pelletier/go-toml/discussions/823

Instead of multiline being a no-op when used on non-string or non-array, it should be pushed down for the value if it is an array. I think this would match people's expectations, as seen in the discussion.

For a case like this:

struct {
  Field map[string][][]string `toml:",multiline"`
}

it should only make the outer array multiline. Maybe at some point we'll need a different API for those who want more granular control to emit toml.

pelletier avatar Oct 30 '22 21:10 pelletier