code: func (s RefSpec) Validate() error {
  	spec := string(s)
  	if strings.Count(spec, refSpecSeparator) != 1 {
  		return ErrRefSpecMalformedSeparator
  	}
  
  	sep := strings.Index(spec, refSpecSeparator)
  	if sep == len(spec)-1 {
  		return ErrRefSpecMalformedSeparator
  	}
  
  	ws := strings.Count(spec[0:sep], refSpecWildcard)
  	wd := strings.Count(spec[sep+1:], refSpecWildcard)
  	if ws == wd && ws < 2 && wd < 2 {
  		return nil
  	}
  
  	return ErrRefSpecMalformedWildcard
  }
docs: // Validate validates the RefSpec