Fix up golangci-lint errors.

Signed-off-by: Ben Kochie <superq@gmail.com>
This commit is contained in:
Ben Kochie 2021-03-16 10:29:03 +01:00
parent 8be6fd79d9
commit 53535551f5
No known key found for this signature in database
GPG Key ID: C646B23C9E3245F1
5 changed files with 11 additions and 10 deletions

View File

@ -522,7 +522,7 @@ func getHashBuffer() []byte {
func putHashBuffer(b []byte) {
b = b[:0]
//lint:ignore SA6002 relax staticcheck verification.
//nolint:staticcheck // Ignore SA6002 relax staticcheck verification.
hashBuffers.Put(b)
}

View File

@ -309,6 +309,7 @@ func TestMultiStage(t *testing.T) {
if !reflect.DeepEqual(alerts, alerts1) {
t.Fatal("Input not equal to input of MultiStage")
}
//nolint:staticcheck // Ignore SA1029
ctx = context.WithValue(ctx, "key", "value")
return ctx, alerts2, nil
}),

View File

@ -122,7 +122,7 @@ func (c *Collector) Check() string {
for _, exp := range expected {
found := len(exp) == 0 && len(alerts) == 0
report += fmt.Sprintf("---\n")
report += "---\n"
for _, e := range exp {
report += fmt.Sprintf("- %v\n", c.opts.alertString(e))
@ -136,10 +136,10 @@ func (c *Collector) Check() string {
}
if found {
report += fmt.Sprintf(" [ ✓ ]\n")
report += " [ ✓ ]\n"
} else {
c.t.Fail()
report += fmt.Sprintf(" [ ✗ ]\n")
report += " [ ✗ ]\n"
}
}
}

View File

@ -113,7 +113,7 @@ func (c *Collector) check() string {
for _, exp := range expected {
found := len(exp) == 0 && len(alerts) == 0
report += fmt.Sprintf("---\n")
report += "---\n"
for _, e := range exp {
report += fmt.Sprintf("- %v\n", c.opts.alertString(e))
@ -127,10 +127,10 @@ func (c *Collector) check() string {
}
if found {
report += fmt.Sprintf(" [ ✓ ]\n")
report += " [ ✓ ]\n"
} else {
c.t.Fail()
report += fmt.Sprintf(" [ ✗ ]\n")
report += " [ ✗ ]\n"
}
}
}

View File

@ -122,7 +122,7 @@ func (c *Collector) Check() string {
for _, exp := range expected {
found := len(exp) == 0 && len(alerts) == 0
report += fmt.Sprintf("---\n")
report += "---\n"
for _, e := range exp {
report += fmt.Sprintf("- %v\n", c.opts.alertString(e))
@ -136,10 +136,10 @@ func (c *Collector) Check() string {
}
if found {
report += fmt.Sprintf(" [ ✓ ]\n")
report += " [ ✓ ]\n"
} else {
c.t.Fail()
report += fmt.Sprintf(" [ ✗ ]\n")
report += " [ ✗ ]\n"
}
}
}