Golang encoding/asn1.UnmarshalWithParams function example

package encoding/asn1

UnmarshalWithParams allows field parameters to be specified for the top-level element. The form of the params is the same as the field tags.

Golang encoding/asn1.UnmarshalWithParams function usage example

 type searchEntry struct {
  keyword string
 }

 value := searchEntry{}
 param := "application,tag:4"

 if _, err := asn1.UnmarshalWithParams(data, &value, param); err != nil {
  panic(err)
 }

Reference :

http://golang.org/pkg/encoding/asn1/#UnmarshalWithParams

Advertisement