chore: Enable additional gocritic (#13713)
This commit is contained in:
parent
2ae65d1a94
commit
564f24a0a4
|
|
@ -84,6 +84,7 @@ linters-settings:
|
|||
- caseOrder
|
||||
- codegenComment
|
||||
- deferInLoop
|
||||
- dupArg
|
||||
- dupBranchBody
|
||||
- dupCase
|
||||
- dupSubExpr
|
||||
|
|
@ -92,7 +93,10 @@ linters-settings:
|
|||
- evalOrder
|
||||
- exitAfterDefer
|
||||
- externalErrorReassign
|
||||
- flagName
|
||||
- mapKey
|
||||
- nilValReturn
|
||||
- offBy1
|
||||
- regexpPattern
|
||||
- sloppyTypeAssert
|
||||
- sortSlice
|
||||
|
|
|
|||
|
|
@ -248,7 +248,12 @@ func snmpTranslateCall(oid string) (mibName string, oidNum string, oidText strin
|
|||
}
|
||||
if i := strings.Index(obj, "("); i != -1 {
|
||||
obj = obj[i+1:]
|
||||
oidNum += "." + obj[:strings.Index(obj, ")")]
|
||||
if j := strings.Index(obj, ")"); j != -1 {
|
||||
oidNum += "." + obj[:j]
|
||||
} else {
|
||||
return "", "", "", "", fmt.Errorf("getting OID number from: %s", obj)
|
||||
}
|
||||
|
||||
} else {
|
||||
oidNum += "." + obj
|
||||
}
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ func newM2() telegraf.Metric {
|
|||
map[string]interface{}{
|
||||
"Request": "/mixed/CASE/paTH/?from=-1D&to=now",
|
||||
"req/sec": 5,
|
||||
" whitespace ": " whitespace\t",
|
||||
" whitespace ": " whitespace\t", //nolint:gocritic // additional whitespace on purpose for testing
|
||||
},
|
||||
time.Now(),
|
||||
)
|
||||
|
|
|
|||
Loading…
Reference in New Issue