code: func (bh *Header) AddReadGroup(rg *ReadGroup) error {
  	if _, ok := bh.seenGroups[rg.name]; ok {
  		return errDupReadGroup
  	}
  	if rg.owner != nil || rg.id >= 0 {
  		return errUsedReadGroup
  	}
  	rg.owner = bh
  	rg.id = int32(len(bh.rgs))
  	bh.seenGroups[rg.name] = rg.id
  	bh.rgs = append(bh.rgs, rg)
  	return nil
  }
docs: // AddReadGroup adds rg to the Header.