code: func (s OptionSelector) Select(data []byte, options []Option) ([]Option, bool) {
  	var current Option
  	var has bool
  	index := -1
  
  	alloc := s.Alloc
  	if alloc == nil {
  		alloc = defaultAlloc
  	}
  	check := s.Check
  	if check == nil {
  		check = defaultCheck
  	}
  
  	ok := ScanOptions(data, func(idx int, name, attr, val []byte) Control {
  		if idx != index {
  			if has && check(current) {
  				if s.Flags&SelectCopy != 0 {
  					current = current.Copy(alloc(current.Size()))
  				}
  				options = append(options, current)
  				has = false
  			}
  			if s.Flags&SelectUnique != 0 {
  				for i := len(options) - 1; i >= 0; i-- {
  					if bytes.Equal(options[i].Name, name) {
  						return ControlSkip
  					}
  				}
  			}
  			index = idx
  			current = Option{Name: name}
  			has = true
  		}
  		if attr != nil {
  			current.Parameters.Set(attr, val)
  		}
  
  		return ControlContinue
  	})
  	if has && check(current) {
  		if s.Flags&SelectCopy != 0 {
  			current = current.Copy(alloc(current.Size()))
  		}
  		options = append(options, current)
  	}
  
  	return options, ok
  }
docs: // Select parses header data and appends it to given slice of Option.
  // It also returns flag of successful (wellformed input) parsing.