diff options
Diffstat (limited to 'src/crypto/x509/x509_test.go')
-rw-r--r-- | src/crypto/x509/x509_test.go | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/crypto/x509/x509_test.go b/src/crypto/x509/x509_test.go index ead0453..548b8d9 100644 --- a/src/crypto/x509/x509_test.go +++ b/src/crypto/x509/x509_test.go @@ -19,6 +19,7 @@ import ( "crypto/x509/pkix" "encoding/asn1" "encoding/base64" + "encoding/gob" "encoding/hex" "encoding/pem" "fmt" @@ -3999,3 +4000,13 @@ func TestCertificatePoliciesGODEBUG(t *testing.T) { t.Errorf("cert.Policies = %v, want: %v", cert.Policies, expectPolicies) } } + +func TestGob(t *testing.T) { + // Test that gob does not reject Certificate. + // See go.dev/issue/65633. + cert := new(Certificate) + err := gob.NewEncoder(io.Discard).Encode(cert) + if err != nil { + t.Fatal(err) + } +} |