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

Fix issue 12 #14

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Fix issue 12 #14

wants to merge 2 commits into from

Conversation

DBX12
Copy link
Contributor

@DBX12 DBX12 commented Oct 28, 2022

Description

Changed the way used initiator types are tracked. The map initiatorTypesUsed is no longer filled on the fly but is defined before looping over log entries. The slice initiatorTypeOrder is ensuring the order when rendering the legend. This also stabilizes the test since the order of the initiator types is now predictable

Fixes #12

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

  • Running existing tests even multiple times with cleaning the cache (go clean -testcache)
  • Created new tests for newly added logic

Checklist:

  • My code has been linted (make lint)
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • I have rebased my branch to include the latest changes from master

I'm participating in Hacktoberfest 2022. If you like this PR, I'd be glad if you could add the hacktoberfest-accepted label to it and help me reach my goal :)

Since the map keys are predefined, we can no longer rely on
len(initiatorTypesUsed).
Maps do not guarantee the order of its elements, an oversight I made during the
initial implementation. This list defines the order to render the types in the
legend, which also stabilizes the tests.
@ghost
Copy link

ghost commented Oct 28, 2022

👇 Click on the image for a new way to code review
  • Make big changes easier — review code in small groups of related files

  • Know where to start — see the whole change at a glance

  • Take a code tour — explore the change with an interactive tour

  • Make comments and review — all fully sync’ed with github

    Try it now!

Review these changes using an interactive CodeSee Map

Legend

CodeSee Map Legend

@dnnrly
Copy link
Owner

dnnrly commented Oct 28, 2022

I don't have the capacity to review this right now but it certainly qualifies for Hacktoberfest.

1 similar comment
@dnnrly
Copy link
Owner

dnnrly commented Oct 28, 2022

I don't have the capacity to review this right now but it certainly qualifies for Hacktoberfest.

@DBX12
Copy link
Contributor Author

DBX12 commented Oct 28, 2022

Thank you :) I'm pretty confident that is the fix for the issue. I got mislead by the idea of maps being ordered in golang as the order of map-like arrays in php is guaranteed. But take your time for reviewing it as soon as you have it :)

@DBX12 DBX12 mentioned this pull request Nov 18, 2022
11 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fix unit tests in master
2 participants