From 59c6a5905b08076cb7146112e89012d85a3b9f56 Mon Sep 17 00:00:00 2001 From: ICHINOSE Shogo Date: Sun, 26 Apr 2026 15:47:50 +0900 Subject: [PATCH] Exclude crypto/sha3.Read and crypto/sha3.Write by default Co-authored-by: Copilot --- errcheck/excludes.go | 3 +++ testdata/sha3.go | 19 +++++++++++++++++++ 2 files changed, 22 insertions(+) create mode 100644 testdata/sha3.go diff --git a/errcheck/excludes.go b/errcheck/excludes.go index 3e28a2f..1ccc631 100644 --- a/errcheck/excludes.go +++ b/errcheck/excludes.go @@ -50,6 +50,9 @@ var DefaultExcludedSymbols = []string{ // hash "(hash.Hash).Write", + "(*crypto/sha3.SHA3).Write", + "(*crypto/sha3.SHAKE).Read", + "(*crypto/sha3.SHAKE).Write", // hash/maphash "(*hash/maphash.Hash).Write", diff --git a/testdata/sha3.go b/testdata/sha3.go new file mode 100644 index 0000000..3374112 --- /dev/null +++ b/testdata/sha3.go @@ -0,0 +1,19 @@ +//go:build go1.24 + +package main + +import ( + "crypto/sha3" +) + +func ignoreSHA3() { + h := sha3.New256() + h.Write([]byte("hello world")) // EXCLUDED +} + +func ignoreSHA3_SHAKE() { + h := sha3.NewSHAKE256() + h.Write([]byte("hello world")) // EXCLUDED + buf := make([]byte, 32) + h.Read(buf) // EXCLUDED +}