]> Cypherpunks repositories - gostls13.git/commit
hash/maphash: add WriteComparable and Comparable
authorqiulaidongfeng <2645477756@qq.com>
Wed, 25 Sep 2024 10:32:49 +0000 (10:32 +0000)
committerKeith Randall <khr@golang.org>
Wed, 2 Oct 2024 15:54:11 +0000 (15:54 +0000)
commit03103a54d830ee14187aac7720e42000927a6ce9
treeba54f0199dce8d8384d6edda28226331c0e86bde
parent658a6a6e1f0a4e0a41ccb5618b0cbf9abe9a7ff4
hash/maphash: add WriteComparable and Comparable

Default, use  hash function in the runtime package.
If the build tag is purego or raw memory cannot be hash directly,
use reflect get each field to hash separately.

Fixes #54670

Change-Id: Ic968864c9c3c51883967d4f6dc24432385c7dc79
GitHub-Last-Rev: 5ae8a28834c8b809a52c74617e2a8530acec8095
GitHub-Pull-Request: golang/go#69166
Reviewed-on: https://go-review.googlesource.com/c/go/+/609761
Reviewed-by: Keith Randall <khr@google.com>
Reviewed-by: Keith Randall <khr@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: David Chase <drchase@google.com>
api/next/54670.txt [new file with mode: 0644]
doc/next/6-stdlib/99-minor/hash/maphash/54670.md [new file with mode: 0644]
src/hash/maphash/maphash.go
src/hash/maphash/maphash_purego.go
src/hash/maphash/maphash_runtime.go
src/hash/maphash/maphash_test.go