crypto: improve panic message when a hash function is unavailable

Change-Id: I6834dda4b1fe5db5710d1020b26104ba6a6a6964
Reviewed-on: https://go-review.googlesource.com/c/go/+/745661
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Auto-Submit: Filippo Valsorda <filippo@golang.org>
Reviewed-by: Roland Shoemaker <roland@golang.org>
Reviewed-by: Daniel McCarney <daniel@binaryparadox.net>
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
This commit is contained in:
Filippo Valsorda 2026-02-14 16:55:34 +01:00 committed by Gopher Robot
parent 6de59e2070
commit 2361851aa9

View file

@ -131,7 +131,7 @@ func (h Hash) New() hash.Hash {
return f()
}
}
panic("crypto: requested hash function #" + strconv.Itoa(int(h)) + " is unavailable")
panic("crypto: requested hash function unavailable: " + h.String())
}
// Available reports whether the given hash function is linked into the binary.