File tree 1 file changed +4
-2
lines changed
1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -27,7 +27,7 @@ type OID struct {
27
27
// ParseOID parses a Object Identifier string, represented by ASCII numbers separated by dots.
28
28
func ParseOID (oid string ) (OID , error ) {
29
29
var o OID
30
- return o , o .UnmarshalText ([] byte ( oid ) )
30
+ return o , o .unmarshalOIDText ( oid )
31
31
}
32
32
33
33
func newOIDFromDER (der []byte ) (OID , bool ) {
@@ -119,8 +119,10 @@ func (o OID) MarshalText() ([]byte, error) {
119
119
120
120
// UnmarshalText implements [encoding.TextUnmarshaler]
121
121
func (o * OID ) UnmarshalText (text []byte ) error {
122
- oid := string (text )
122
+ return o .unmarshalOIDText (string (text ))
123
+ }
123
124
125
+ func (o * OID ) unmarshalOIDText (oid string ) error {
124
126
// (*big.Int).SetString allows +/- signs, but we don't want
125
127
// to allow them in the string representation of Object Identifier, so
126
128
// reject such encodings.
You can’t perform that action at this time.
0 commit comments