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 wrong time.Parse args order #2515

Merged
merged 2 commits into from
May 29, 2024

Conversation

alingse
Copy link
Contributor

@alingse alingse commented Mar 17, 2024


Description

I write a linter to fix some bugs that occurred in my real work. --> https://github.com/alingse/sundrylint

in this case, it report the wrong params order for time.Parse, this should be time.Parse(layout, value)

and I run a github actions to check to most popular golang repos, here is minio failure

https://github.com/alingse/sundrylint/actions/runs/8315226905/job/22753339432

the linter output is

Error: /home/runner/work/sundrylint/sundrylint/bosun/annotate/cmd/annotate/main.go:55:16: call func time.Parse may have incorrect args order, potentially swapping the layout and value arguments.

Fixes #0000 (fill in)

Type of change

  • 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?

  • Test A
  • Test B

Checklist:

  • This contribution follows the project's code of conduct
  • This contribution follows the project's contributing guidelines
  • My code follows the style guidelines of this project
  • 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
  • Any dependent changes have been merged and published in downstream modules

Copy link
Contributor

@neilfordyce neilfordyce left a comment

Choose a reason for hiding this comment

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

Good find, thanks for the fix.

@neilfordyce neilfordyce merged commit eaa4157 into bosun-monitor:master May 29, 2024
6 checks passed
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.

None yet

2 participants