golangci-lint/test/testdata/errcheck_ignore_default.go
Sergey Vilgelm b77118fdac
Use errcheck from main repo instead of golangci-lint fork (#1319)
Co-authored-by: Roman Leventov <leventov@ya.ru>
Co-authored-by: Fernandez Ludovic <ldez@users.noreply.github.com>
2021-02-25 13:16:48 +01:00

25 lines
457 B
Go

//args: -Eerrcheck
//config: linters-settings.errcheck.check-blank=true
package testdata
import (
"crypto/sha256"
"fmt"
"os"
)
func TestErrcheckIgnoreHashWriteByDefault() []byte {
h := sha256.New()
h.Write([]byte("food"))
return h.Sum(nil)
}
func TestErrcheckIgnoreFmtByDefault(s string) int {
n, _ := fmt.Println(s)
return n
}
func TestErrcheckNoIgnoreOs() {
_, _ = os.Open("f.txt") // ERROR "Error return value of `os.Open` is not checked"
}