PER decode functions are generated when the -per (packed encoding rules), -aper (aligned packed encoding rules), or -uper (unaligned packed encoding rules), switch is specified on the command line. For Go, -per and -aper have the same meaning - aligned PER decoders will be generated. The -uper option is used to generate unaligned encoders. There is no option to switch between aligned and unaligned at run-time as there is for some other languages. For the remainder of this section, the acronym PER will be used to mean either aligned or unaligned PER.
For each ASN.1 production defined in the ASN.1 source file, a PER decode function is generated. This function decodes an encoded ASN.1 message contained in a message buffer (byte slice) and stores the results in a data variable of a Go type corresponding to the ASN.1 production type.