code: func WriteTo(w io.Writer, idx *Index) error {
  	err := binary.Write(w, binary.LittleEndian, tbiMagic)
  	if err != nil {
  		return err
  	}
  
  	err = binary.Write(w, binary.LittleEndian, int32(len(idx.idx.Refs)))
  	if err != nil {
  		return err
  	}
  	err = writeTabixHeader(w, idx)
  	if err != nil {
  		return err
  	}
  
  	return internal.WriteIndex(w, &idx.idx, "tabix")
  }
docs: // WriteTo writes the index to the given io.Writer. Note that
  // the tabix specification states that the index is stored as BGZF, but
  // WriteTo does not perform compression.