bosun-monitor / bosun

Time Series Alerting Framework
http://bosun.org
MIT License
3.4k stars 495 forks source link

fix wrong time.Parse args order #2515

Closed alingse closed 3 months ago

alingse commented 5 months ago

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

How has this been tested?

Checklist: