aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorFilippo Valsorda <filippo@golang.org>2025-07-01 11:51:37 +0200
committerGopher Robot <gobot@golang.org>2025-07-03 13:33:26 -0700
commitdd687c386016445b2f4abc2a958963dd2056d95f (patch)
tree79bf462b4190c2c0560da05f6c605fa4e7a743d6 /src
parentb3251514531123d7fd007682389bce7428d159a0 (diff)
downloadgo-dd687c386016445b2f4abc2a958963dd2056d95f.tar.xz
hash: document that Clone may only return ErrUnsupported or a nil error
Updates #69521 Change-Id: I6a6a6964ce384a80c4c89efe67c260dc6e9ed6c8 Reviewed-on: https://go-review.googlesource.com/c/go/+/685235 Auto-Submit: Filippo Valsorda <filippo@golang.org> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Austin Clements <austin@google.com> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> Auto-Submit: Austin Clements <austin@google.com>
Diffstat (limited to 'src')
-rw-r--r--src/hash/hash.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/hash/hash.go b/src/hash/hash.go
index d4b9a91663..24ee9929c9 100644
--- a/src/hash/hash.go
+++ b/src/hash/hash.go
@@ -64,7 +64,8 @@ type Hash64 interface {
// unless GOFIPS140=v1.0.0 is set.
//
// If a hash can only determine at runtime if it can be cloned (e.g. if it wraps
-// another hash), it may return an error wrapping [errors.ErrUnsupported].
+// another hash), Clone may return an error wrapping [errors.ErrUnsupported].
+// Otherwise, Clone must always return a nil error.
type Cloner interface {
Hash
Clone() (Cloner, error)