Skip to content
This repository has been archived by the owner on Oct 11, 2018. It is now read-only.

Omitempty option for creating maps #18

Closed
klauspost opened this issue Sep 12, 2014 · 4 comments · Fixed by #19
Closed

Omitempty option for creating maps #18

klauspost opened this issue Sep 12, 2014 · 4 comments · Fixed by #19

Comments

@klauspost
Copy link

It would be lovely to have an ",omitempty" option to struct members, so they can be omitted if empty similar to the json encoder.

@fatih
Copy link
Owner

fatih commented Sep 13, 2014

Sounds a good idea! I'll look into it, thanks!

@klauspost
Copy link
Author

Thanks!

@fatih
Copy link
Owner

fatih commented Sep 14, 2014

This is merged now. Please refer to the doc for more info: http://godoc.org/github.com/fatih/structs#Struct.Map I'll add this functionality to Fields and Values method too so it's in sync with them. Thanks for the tip again and let me know if you hit problems.

@klauspost
Copy link
Author

Thanks a lot!

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

Successfully merging a pull request may close this issue.

2 participants