bosun
bosun copied to clipboard
fix wrong time.Parse args order
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
- [x] 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:
- [x] This contribution follows the project's code of conduct
- [x] This contribution follows the project's contributing guidelines
- [x] My code follows the style guidelines of this project
- [x] I have performed a self-review of my own code
- [x] I have commented my code, particularly in hard-to-understand areas
- [x] I have made corresponding changes to the documentation
- [x] I have added tests that prove my fix is effective or that my feature works
- [x] New and existing unit tests pass locally with my changes
- [x] Any dependent changes have been merged and published in downstream modules