golangci-lint: enable mirror linter

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn 2025-05-19 18:07:10 +02:00
parent 2ef9ab4494
commit 062ad57ce2
No known key found for this signature in database
GPG Key ID: 76698F39D527CE8C
3 changed files with 3 additions and 2 deletions

View File

@ -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.

View File

@ -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
}

View File

@ -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() {