Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support "omitempty" like JSON and XML #73

Closed
chowey opened this issue Feb 17, 2015 · 1 comment · Fixed by #81
Closed

Support "omitempty" like JSON and XML #73

chowey opened this issue Feb 17, 2015 · 1 comment · Fixed by #81

Comments

@chowey
Copy link

chowey commented Feb 17, 2015

It would be handy to tag my go struct with "omitempty" so that the toml writer does not write the value if it is empty. The go standard libraries json and xml have something similar.

Example:

type Settings struct {
    Port string `toml:"port,omitempty"`
}
@bbuck
Copy link
Contributor

bbuck commented May 1, 2015

At least I wasn't the only one that wanted this feature!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants