10000 Add support for omitempty tag option by radeksimko · Pull Request #60 · go-ini/ini · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Add support for omitempty tag option #60

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

Merged
merged 1 commit into from Aug 5, 2016
Merged

Add support for omitempty tag option #60

merged 1 commit into from Aug 5, 2016

Conversation

radeksimko
Copy link
Contributor

Closes #59

The isEmptyValue is shamelessly stolen from https://github.com/golang/go/tree/master/src/encoding/json , I just added support for time.Time. 😉

return fmt.Errorf("Expected max. 2 comma-separated values in a tag, %d given", len(opts))
}

if opts[0] == "-" {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If tag is -, then should get out of loop directly, so we need if tag == "-" {, then do the omitempty check.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR updated.

@unknwon
Copy link
Member
unknwon commented Aug 5, 2016

Thanks!

@unknwon unknwon merged commit 8e15fc6 into go-ini:master Aug 5, 2016
unknwon added a commit that referenced this pull request Aug 5, 2016
@radeksimko radeksimko deleted the f-omitempty branch August 6, 2016 20:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0