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

Make the Tags a set to avoid issues of DeDup #203

Merged
merged 2 commits into from
Aug 20, 2020

Conversation

MushuEE
Copy link
Contributor

@MushuEE MushuEE commented Aug 16, 2020

Translated all tags into a set which should remove the need to ever track dupes and or sort by ID

Fix for #196

*I think there are easier ways to solve this but I am learning Go and wanted to use this as an opportunity to get a little better. Not hard feelings if this gets closed! Happy to solve the bug using dedup or another method. I think this is just more resilient long term.

image

Tested 👍

@MushuEE
Copy link
Contributor Author

MushuEE commented Aug 19, 2020

@tstromberg I saw that you merged a quick fix for tags, would you like me to close this?

@tstromberg
Copy link
Collaborator

@MushuEE - Sorry about that. I merged a fix because I had made because I wanted to give more time to consider the implications of changing the data format.

After looking more closely at the code, I like your PR better. Do you mind updating the merge conflict? I'll be able to merge it then.

@MushuEE
Copy link
Contributor Author

MushuEE commented Aug 19, 2020

Merge done 👍

@@ -160,7 +160,7 @@
{{ end }}
</td>
<td class="cell-tags">
{{ range .Tags }}<div class="gh-tag tag-{{ .ID }}" title="{{ .Desc }}">{{ .ID }}</div> {{ end }}
{{ range $k, $_ := .Tags }}<div class="gh-tag tag-{{ $k.ID }}" title="{{ $k.Desc }}">{{ $k.ID }}</div> {{ end }}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Ahh, now I remember why I did this: consistent sorting of tags during display. I see that the Go developers did add sorting to template iteration though, so maybe this isn't a problem after all:

golang/go@a5950df

If it is, we can always add a slice representation later. Thanks!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

was a concern but yep, should be able to do one sort to slice right before template generation👍

@tstromberg tstromberg merged commit 3cf61e3 into google:master Aug 20, 2020
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