func parseBool(bytes []byte) (ret bool, err error) {
	if len(bytes) != 1 {
		err = SyntaxError{"invalid boolean"}
		return
	}
	switch bytes[0] {
	case 0:
		ret = false
	case 0xff:
		ret = true
	default:
		err = SyntaxError{"invalid boolean"}
	}
	return
}
We start by dealing with each of the primitive types in turn.
BOOLEAN
package asn1
import (
	"errors"
	"fmt"
	"math/big"
	"reflect"
	"strconv"
	"time"
	"unicode/utf8"
)
type StructuralError struct {
	Msg string
}
func (e StructuralError) Error() string { return "asn1: structure error: " + e.Msg }
type SyntaxError struct {
	Msg string
}
func (e SyntaxError) Error() string { return "asn1: syntax error: " + e.Msg }