add golangci-lint linter (#5499)

This commit is contained in:
Ondřej Benkovský
2022-07-10 20:06:33 +02:00
committed by GitHub
parent abc5ac8017
commit c2dbb7141a
104 changed files with 83 additions and 184 deletions

View File

@@ -44,6 +44,5 @@ func TestFileLoop(t *testing.T) {
// For now: document current behavior in this test.
if r.Rcode != dns.RcodeServerFailure {
t.Errorf("Rcode should be dns.RcodeServerFailure: %d", r.Rcode)
}
}

View File

@@ -9,6 +9,7 @@ import (
"github.com/miekg/dns"
"google.golang.org/grpc"
"google.golang.org/grpc/credentials/insecure"
)
func TestGrpc(t *testing.T) {
@@ -24,7 +25,7 @@ func TestGrpc(t *testing.T) {
ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
defer cancel()
conn, err := grpc.DialContext(ctx, tcp, grpc.WithInsecure(), grpc.WithBlock())
conn, err := grpc.DialContext(ctx, tcp, grpc.WithTransportCredentials(insecure.NewCredentials()), grpc.WithBlock())
if err != nil {
t.Fatalf("Expected no error but got: %s", err)
}

View File

@@ -18,7 +18,6 @@ import (
)
func TestMetricNaming(t *testing.T) {
walker := validMetricWalker{}
err := filepath.Walk("..", walker.walk)

View File

@@ -158,7 +158,6 @@ func (l logfmt) Visit(n ast.Node) ast.Visitor {
for i, u := range bl.Value {
// disregard "
if i == 1 && !unicode.IsUpper(u) {
l.err = fmt.Errorf("test error message %s doesn't start with an uppercase", bl.Value)
return nil
}
if i == 1 {

View File

@@ -167,7 +167,6 @@ func sectionsFromReadme(readme string) error {
return fmt.Errorf("Sections incomplete or ordered wrong: %q, want (at least): Name, Descripion, Syntax and Examples", readme)
}
return nil
}
func create(c map[string]string) {

View File

@@ -214,5 +214,4 @@ www IN AAAA ::1
return
}
}
}