code: func parseAux(aux []byte) ([]sam.Aux, error) {
  	if len(aux) == 0 {
  		return nil, nil
  	}
  	aa := make([]sam.Aux, 0, 4)
  	for i := 0; i+2 < len(aux); {
  		t := aux[i+2]
  		switch j := jumps[t]; {
  		case j > 0:
  			j += 3
  			aa = append(aa, sam.Aux(aux[i:i+j:i+j]))
  			i += j
  		case j < 0:
  			switch t {
  			case 'Z', 'H':
  				j := bytes.IndexByte(aux[i:], 0)
  				if j == -1 {
  					return nil, errors.New("bam: invalid zero terminated data: no zero")
  				}
  				aa = append(aa, sam.Aux(aux[i:i+j:i+j]))
  				i += j + 1
  			case 'B':
  				length := binary.LittleEndian.Uint32(aux[i+4 : i+8])
  				j = int(length)*jumps[aux[i+3]] + int(unsafe.Sizeof(length)) + 4
  				if j < 0 || i+j < 0 || i+j > len(aux) {
  					return nil, fmt.Errorf("bam: invalid array length for aux data: %d", length)
  				}
  				aa = append(aa, sam.Aux(aux[i:i+j:i+j]))
  				i += j
  			}
  		default:
  			return nil, fmt.Errorf("bam: unrecognised optional field type: %q", t)
  		}
  	}
  	return aa, nil
  }
docs: // parseAux examines the data of a SAM record's OPT fields,
  // returning a slice of sam.Aux that are backed by the original data.