-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
Linter fixes - gosimple #9046
Linter fixes - gosimple #9046
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤝 ✅ CLA has been signed. Thank you!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like new artifacts were built from this PR. Get them here!
Artifact URLs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here are fixes for problems found by
gosimple
:strings.ContainsAny(s, "*?[")
insteadstrings.IndexAny(s, "*?[") >= 0
fmt.Sprintf
msg := fmt.Sprintf("catmaster is incorrect")
make(map[string][]point)
insteadmake(map[string][]point, 0)
return
statementbreak
statementfmt.Sprintf
fmt.Sprintf("%s", firstParseErrorStr)
min, _ := f.values[statisticTypeMin]
bytes.Equal(value, []byte("No"))
insteadbytes.Compare(value, []byte("No")) == 0
len()
for nil slices is defined as zeroif rest == nil || len(rest) == 0 {
!ok
if ok == false {
(switch i := i.(type))
could eliminate type assertions in switch casesdelete
return f.namePass.Match(key)
instead ofif f.namePass.Match(key) { return true }; return false
m.metrics = append(m.metrics, metrics...)
time.Since
instead oftime.Now().Sub
These need to be reviewed carefully and fixed in the near future:
...
) withregexp.Compile
to avoid having to escape twicefor { select {} }
select
with a single case