parser.go
func (d *Directive) getMechanism() string {
	if len(d.term) <= 0 {
		return ""
	}

	term := d.term
	if isQualifier(d.term[0]) {
		term = term[1:]
	}
	index := strings.Index(term, ":")
	if index == -1 {
		return term
	}
	return term[0:index]
}
func (d *Directive) getMechanism() string {
	if len(d.term) <= 0 {
		return ""
	}

	term := d.term
	if isQualifier(d.term[0]) {
		term = term[1:]
	}
	index := strings.Index(term, ":")
	if index == -1 {
		return term
	}
	return term[0:index]
}
// Get the mechanism (i.e. mx, a, all, ip4, ...)