diff options
author | Roland Bracewell Shoemaker <rolandshoemaker@gmail.com> | 2020-10-05 15:46:23 +0000 |
---|---|---|
committer | Roland Shoemaker <roland@golang.org> | 2020-10-05 16:55:37 +0000 |
commit | e70bbc702f093ab2d5e305ddb33b8dca2baf8104 (patch) | |
tree | e53f336db023a9742b66e03cb42fcb1f84c3a3e0 /src/encoding/asn1 | |
parent | 39d562ecea74bb41aa8fbb9d016fa64165e84bb3 (diff) | |
download | go-e70bbc702f093ab2d5e305ddb33b8dca2baf8104.tar.gz go-e70bbc702f093ab2d5e305ddb33b8dca2baf8104.zip |
encoding/asn1: clarify use of SET suffix
This change clarifies the usage of the SET type name suffix. Previously
the documentation was somewhat confusing about where the suffix should
be used, and when used what it applied to. For instance the previous
language could be interpreted such that []exampleSET would be parsed as
a SEQUENCE OF SET, which is incorrect as the SET suffix only applies to
slice types, such as type exampleSET []struct{} which is parsed as a
SET OF SEQUENCE.
Change-Id: I74201d9969f931f69391c236559f66cb460569ec
GitHub-Last-Rev: d0d2ddc587df4564a265c800efb9d8e204002624
GitHub-Pull-Request: golang/go#38543
Reviewed-on: https://go-review.googlesource.com/c/go/+/229078
Trust: Roland Shoemaker <roland@golang.org>
Reviewed-by: Filippo Valsorda <filippo@golang.org>
Diffstat (limited to 'src/encoding/asn1')
-rw-r--r-- | src/encoding/asn1/asn1.go | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/encoding/asn1/asn1.go b/src/encoding/asn1/asn1.go index fa3d4e327b..068594e2a1 100644 --- a/src/encoding/asn1/asn1.go +++ b/src/encoding/asn1/asn1.go @@ -1086,9 +1086,10 @@ func setDefaultValue(v reflect.Value, params fieldParameters) (ok bool) { // If the type of the first field of a structure is RawContent then the raw // ASN1 contents of the struct will be stored in it. // -// If the type name of a slice element ends with "SET" then it's treated as if -// the "set" tag was set on it. This can be used with nested slices where a -// struct tag cannot be given. +// If the name of a slice type ends with "SET" then it's treated as if +// the "set" tag was set on it. This results in interpreting the type as a +// SET OF x rather than a SEQUENCE OF x. This can be used with nested slices +// where a struct tag cannot be given. // // Other ASN.1 types are not supported; if it encounters them, // Unmarshal returns a parse error. |