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

prepend goTag directive on struct tags and omit overridden duplicate struct tags per #2514 #2533

Merged
merged 4 commits into from
Jan 27, 2023

Conversation

StevenACoffman
Copy link
Collaborator

@StevenACoffman StevenACoffman commented Jan 27, 2023

As described in #2514, and without this PR, GoTagFieldHook just appends new tags, so @goTag will not override an existing tag.

Ideally it should override existing tag, since the sole purpose of the @goTag directive is to give control to user.

In this PR, the removeDuplicateTags helper func is introduced to fix #2514

This PR was originally authored by @valllabh in #2531 but I have adjusted it slightly.

I have:

  • [✓] Added tests covering the bug / feature (see testing)
  • [Not Required] Updated any relevant documentation (see docs)

@StevenACoffman StevenACoffman changed the title Valllabh master remove duplicate struct tags due to goTag directive override per #2514 Jan 27, 2023
@coveralls
Copy link

coveralls commented Jan 27, 2023

Coverage Status

Coverage: 75.525% (-0.09%) from 75.615% when pulling c83aa08 on valllabh_master into 5b85e93 on master.

Signed-off-by: Steve Coffman <steve@khanacademy.org>
@StevenACoffman StevenACoffman changed the title remove duplicate struct tags due to goTag directive override per #2514 prepend goTag directive on struct tags and omit overridden duplicate struct tags per #2514 Jan 27, 2023
@StevenACoffman StevenACoffman merged commit 356f4f9 into master Jan 27, 2023
@StevenACoffman StevenACoffman deleted the valllabh_master branch June 10, 2023 18:17
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.

@goTag do not override existing tag
3 participants