Skip to content

Conversation

@reyoung
Copy link

@reyoung reyoung commented Aug 16, 2020

Base on PR #6

Comment on lines +83 to +87
// NOTE: Is there any option we need to add?
// Just treat all tag value as the symbol name for now.
if val != name {
continue
}
Copy link
Owner

Choose a reason for hiding this comment

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

Great question! To start, I think it would be sufficient to lookup the entire tag value as you do now. In the future, we could allow modifying the tag name as an option to mustache.New().

One use case I can see is reusing the json tag. As that tag may have other values following the comma (e.g omitempty), we may want to split the value and use the first element.

I'd be more than happy to accept it as is though.

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