diff --git a/.golangci.yml b/.golangci.yml index fee407cd7..8c105cc55 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -41,6 +41,7 @@ linters: - govet - importas # Enforces consistent import aliases. - ineffassign + - mirror # Detects wrong mirror patterns of bytes/strings usage. - misspell # Detects commonly misspelled English words in comments. - nakedret # Detects uses of naked returns. - nilerr # Detects code that returns nil even if it checks that the error is not nil. diff --git a/cli/command/swarm/ca_test.go b/cli/command/swarm/ca_test.go index 88df4d164..9b7107d4f 100644 --- a/cli/command/swarm/ca_test.go +++ b/cli/command/swarm/ca_test.go @@ -69,7 +69,7 @@ func writeFile(data string) (string, error) { if err != nil { return "", err } - _, err = tmpfile.Write([]byte(data)) + _, err = tmpfile.WriteString(data) if err != nil { return "", err } diff --git a/e2e/cli-plugins/socket_test.go b/e2e/cli-plugins/socket_test.go index c754e2711..2bb93dd8f 100644 --- a/e2e/cli-plugins/socket_test.go +++ b/e2e/cli-plugins/socket_test.go @@ -58,7 +58,7 @@ func TestPluginSocketBackwardsCompatible(t *testing.T) { ptmx, err := pty.Start(command) assert.NilError(t, err, "failed to launch command with fake TTY") - _, _ = ptmx.Write([]byte("hello!")) + _, _ = ptmx.WriteString("hello!") done := make(chan error) go func() {