]> Cypherpunks repositories - gostls13.git/commitdiff
hash: document that Clone may only return ErrUnsupported or a nil error
authorFilippo Valsorda <filippo@golang.org>
Tue, 1 Jul 2025 09:51:37 +0000 (11:51 +0200)
committerGopher Robot <gobot@golang.org>
Thu, 3 Jul 2025 20:33:26 +0000 (13:33 -0700)
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>

src/hash/hash.go

index d4b9a91663c0de15d826467dff2ba4a81d7984e3..24ee9929c9587d7873675febe6b4bb59e6f57a07 100644 (file)
@@ -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)