The default golang JSON (un)marshal implementation respects omitempty inside a field's tag which will effectively omit such field from the resulting JSON if it's not defined in a given struct.
Field int `json:"myName,omitempty"`
I was wondering if there's any interest in such feature for this library - i.e. support something like this:
type Profile struct {
First string `ini:"first"`
Second string `ini:"second,omitempty"`
}
The current implementation doesn't interpret commas in any special way which results in the following output:
[my-section]
first = custom-value
second,omitempty =
The expected behaviour would be
[my-section]
first = custom-value
Is there any reason to support commas inside key names? 😺
The default golang JSON (un)marshal implementation respects
omitemptyinside a field's tag which will effectively omit such field from the resulting JSON if it's not defined in a given struct.I was wondering if there's any interest in such feature for this library - i.e. support something like this:
The current implementation doesn't interpret commas in any special way which results in the following output:
The expected behaviour would be
Is there any reason to support commas inside key names? 😺