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

Return correct tag or tag category for given name #910

Merged
merged 1 commit into from
Nov 21, 2019

Conversation

sirlatrom
Copy link
Contributor

Pointers to Go range variables assigned inside a range end up pointing
to the last element iterated to. See
https://medium.com/golangspec/range-clause-and-the-address-of-iteration-variable-b1796885d2b7.
I don't know if the category slice is sorted alphabetically or
otherwise, but if your category is not the last in the list, you will
get an unexpected result.

Fixes #909

Pointers to Go range variables assigned inside a range end up pointing
to the last element iterated to. See
https://medium.com/golangspec/range-clause-and-the-address-of-iteration-variable-b1796885d2b7.
I don't know if the category slice is sorted alphabetically or
otherwise, but if your category is not the last in the list, you will
get an unexpected result.

Fixes hashicorp#909

Signed-off-by: Sune Keller <absukl@almbrand.dk>
@ghost ghost added the size/xs Relative Sizing: Extra-Small label Nov 21, 2019
Copy link
Contributor

@aareet aareet left a comment

Choose a reason for hiding this comment

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

Thank you for your contribution.

@aareet aareet merged commit 19c7fcb into hashicorp:master Nov 21, 2019
@sirlatrom sirlatrom deleted the 909-tag-category-by-name-fix branch November 22, 2019 13:58
@ghost ghost locked and limited conversation to collaborators Apr 18, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
size/xs Relative Sizing: Extra-Small
Projects
None yet
Development

Successfully merging this pull request may close these issues.

tagCategoryByName and tagByName can return wrong results
2 participants