code: func (c *RemoteConfig) Validate() error {
  	if c.Name == "" {
  		return ErrRemoteConfigEmptyName
  	}
  
  	if len(c.URLs) == 0 {
  		return ErrRemoteConfigEmptyURL
  	}
  
  	for _, r := range c.Fetch {
  		if err := r.Validate(); err != nil {
  			return err
  		}
  	}
  
  	if len(c.Fetch) == 0 {
  		c.Fetch = []RefSpec{RefSpec(fmt.Sprintf(DefaultFetchRefSpec, c.Name))}
  	}
  
  	return nil
  }
docs: // Validate validates the fields and sets the default values.