aboutsummaryrefslogtreecommitdiff
path: root/src/encoding/gob/encode.go
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2024-03-12 12:51:44 -0400
committerRuss Cox <rsc@golang.org>2024-03-14 16:06:11 +0000
commit376be64922f38a78c42c62db189be911160367f8 (patch)
tree0e824935b1d9a7141a6dc7c7ac8a0c782cc784b2 /src/encoding/gob/encode.go
parent4a1038fa52db57cee23a76fd2ea86247eff42f29 (diff)
downloadgo-376be64922f38a78c42c62db189be911160367f8.tar.xz
encoding/gob: make x509.Certificate marshalable again
The OID type is not exported data like most of the other x509 structs. Using it in x509.Certificate made Certificate not gob-compatible anymore, which breaks real-world code. As a temporary fix, make gob ignore that field, making it work as well as it did in Go 1.21. For Go 1.23, we anticipate adding a proper fix and removing the gob workaround. See #65633 and #66249 for more details. For #66249. Fixes #65633. Change-Id: Idd1431d15063b3009e15d0565cd3120b9fa13f61 Reviewed-on: https://go-review.googlesource.com/c/go/+/571095 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Rob Pike <r@golang.org> Reviewed-by: Roland Shoemaker <roland@golang.org>
Diffstat (limited to 'src/encoding/gob/encode.go')
-rw-r--r--src/encoding/gob/encode.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/encoding/gob/encode.go b/src/encoding/gob/encode.go
index 5f4d2539fa..c83071c717 100644
--- a/src/encoding/gob/encode.go
+++ b/src/encoding/gob/encode.go
@@ -601,7 +601,7 @@ func compileEnc(ut *userTypeInfo, building map[*typeInfo]bool) *encEngine {
if ut.externalEnc == 0 && srt.Kind() == reflect.Struct {
for fieldNum, wireFieldNum := 0, 0; fieldNum < srt.NumField(); fieldNum++ {
f := srt.Field(fieldNum)
- if !isSent(&f) {
+ if !isSent(srt, &f) {
continue
}
op, indir := encOpFor(f.Type, seen, building)