mirror of
https://github.com/golang/go.git
synced 2025-05-18 13:54:40 +00:00
encoding/asn1: use reflect.TypeFor for known types
For #60088 Change-Id: I4b2a5c6c59ef26361f343052a4ddaabde5d3bc94 GitHub-Last-Rev: d519835ad592efab031917c83483e5dcbeff1c3a GitHub-Pull-Request: golang/go#62370 Reviewed-on: https://go-review.googlesource.com/c/go/+/524259 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Ian Lance Taylor <iant@google.com> Reviewed-by: Roland Shoemaker <roland@golang.org> Auto-Submit: Ian Lance Taylor <iant@google.com>
This commit is contained in:
parent
6f11650855
commit
dffc47e75a
@ -656,14 +656,14 @@ func parseSequenceOf(bytes []byte, sliceType reflect.Type, elemType reflect.Type
|
|||||||
}
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
bitStringType = reflect.TypeOf(BitString{})
|
bitStringType = reflect.TypeFor[BitString]()
|
||||||
objectIdentifierType = reflect.TypeOf(ObjectIdentifier{})
|
objectIdentifierType = reflect.TypeFor[ObjectIdentifier]()
|
||||||
enumeratedType = reflect.TypeOf(Enumerated(0))
|
enumeratedType = reflect.TypeFor[Enumerated]()
|
||||||
flagType = reflect.TypeOf(Flag(false))
|
flagType = reflect.TypeFor[Flag]()
|
||||||
timeType = reflect.TypeOf(time.Time{})
|
timeType = reflect.TypeFor[time.Time]()
|
||||||
rawValueType = reflect.TypeOf(RawValue{})
|
rawValueType = reflect.TypeFor[RawValue]()
|
||||||
rawContentsType = reflect.TypeOf(RawContent(nil))
|
rawContentsType = reflect.TypeFor[RawContent]()
|
||||||
bigIntType = reflect.TypeOf((*big.Int)(nil))
|
bigIntType = reflect.TypeFor[*big.Int]()
|
||||||
)
|
)
|
||||||
|
|
||||||
// invalidLength reports whether offset + length > sliceLength, or if the
|
// invalidLength reports whether offset + length > sliceLength, or if the
|
||||||
|
Loading…
x
Reference in New Issue
Block a user