code: func (bh *Header) MarshalText() ([]byte, error) {
  	var buf bytes.Buffer
  	if bh.Version != "" {
  		if bh.GroupOrder == GroupUnspecified {
  			fmt.Fprintf(&buf, "@HD\tVN:%s\tSO:%s", bh.Version, bh.SortOrder)
  		} else {
  			fmt.Fprintf(&buf, "@HD\tVN:%s\tSO:%s\tGO:%s", bh.Version, bh.SortOrder, bh.GroupOrder)
  		}
  		for _, tp := range bh.otherTags {
  			fmt.Fprintf(&buf, "\t%s:%s", tp.tag, tp.value)
  		}
  		buf.WriteByte('\n')
  	}
  	for _, r := range bh.refs {
  		fmt.Fprintf(&buf, "%s\n", r)
  	}
  	for _, rg := range bh.rgs {
  		fmt.Fprintf(&buf, "%s\n", rg)
  	}
  	for _, p := range bh.progs {
  		fmt.Fprintf(&buf, "%s\n", p)
  	}
  	for _, co := range bh.Comments {
  		fmt.Fprintf(&buf, "@CO\t%s\n", co)
  	}
  	return buf.Bytes(), nil
  }
docs: // MarshalText implements the encoding.TextMarshaler interface.