test(linters): Enable sloppyLen (#15512)
This commit is contained in:
parent
7037429e6a
commit
f55e02e8fd
|
|
@ -109,6 +109,7 @@ linters-settings:
|
|||
- nilValReturn
|
||||
- offBy1
|
||||
- regexpPattern
|
||||
- sloppyLen
|
||||
- sloppyReassign
|
||||
- sloppyTypeAssert
|
||||
- sortSlice
|
||||
|
|
|
|||
|
|
@ -218,7 +218,7 @@ func (a *Aerospike) parseNodeInfo(acc telegraf.Accumulator, stats map[string]str
|
|||
|
||||
func (a *Aerospike) getNamespaces(n *as.Node, infoPolicy *as.InfoPolicy) ([]string, error) {
|
||||
var namespaces []string
|
||||
if len(a.Namespaces) <= 0 {
|
||||
if len(a.Namespaces) == 0 {
|
||||
info, err := n.RequestInfo(infoPolicy, "namespaces")
|
||||
if err != nil {
|
||||
return namespaces, err
|
||||
|
|
@ -262,7 +262,7 @@ func (a *Aerospike) parseNamespaceInfo(acc telegraf.Accumulator, stats map[strin
|
|||
func (a *Aerospike) getSets(n *as.Node, infoPolicy *as.InfoPolicy) ([]string, error) {
|
||||
var namespaceSets []string
|
||||
// Gather all sets
|
||||
if len(a.Sets) <= 0 {
|
||||
if len(a.Sets) == 0 {
|
||||
stats, err := n.RequestInfo(infoPolicy, "sets")
|
||||
if err != nil {
|
||||
return namespaceSets, err
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ func (d *Dovecot) Gather(acc telegraf.Accumulator) error {
|
|||
d.Servers = append(d.Servers, "127.0.0.1:24242")
|
||||
}
|
||||
|
||||
if len(d.Filters) <= 0 {
|
||||
if len(d.Filters) == 0 {
|
||||
d.Filters = append(d.Filters, "")
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -83,7 +83,7 @@ func (f *File) refreshFilePaths() error {
|
|||
return fmt.Errorf("could not compile glob %q: %w", file, err)
|
||||
}
|
||||
files := g.Match()
|
||||
if len(files) <= 0 {
|
||||
if len(files) == 0 {
|
||||
return fmt.Errorf("could not find file(s): %v", file)
|
||||
}
|
||||
allFiles = append(allFiles, files...)
|
||||
|
|
|
|||
|
|
@ -221,7 +221,7 @@ func TestSubscribeClientIntegration(t *testing.T) {
|
|||
}
|
||||
}
|
||||
|
||||
if len(newRemaining) <= 0 {
|
||||
if len(newRemaining) == 0 {
|
||||
return
|
||||
}
|
||||
|
||||
|
|
@ -361,7 +361,7 @@ func TestSubscribeClientIntegrationAdditionalFields(t *testing.T) {
|
|||
}
|
||||
}
|
||||
|
||||
if len(newRemaining) <= 0 {
|
||||
if len(newRemaining) == 0 {
|
||||
return
|
||||
}
|
||||
// Test if the received metric matches one of the expected
|
||||
|
|
|
|||
|
|
@ -511,7 +511,7 @@ func (c *X509Cert) collectCertURLs() []*url.URL {
|
|||
|
||||
for _, path := range c.globpaths {
|
||||
files := path.Match()
|
||||
if len(files) <= 0 {
|
||||
if len(files) == 0 {
|
||||
c.Log.Errorf("could not find file: %v", path.GetRoots())
|
||||
continue
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue