code: func (m *VagrantManifest) Add(version string, provider *VagrantProvider) {
  	// strip the leading "v" from the version as Vagrant only supports
  	// versions like X.Y.Z, see https://github.com/flynn/flynn/issues/2230
  	version = strings.TrimPrefix(version, "v")
  
  	versions := make(sortVersions, 0, len(m.Versions)+1)
  	for _, v := range m.Versions {
  		if v.version() == version {
  			providers := make([]*VagrantProvider, len(v.Providers))
  			added := false
  			for i, p := range v.Providers {
  				if p.Name == provider.Name {
  					// replace existing provider
  					providers[i] = provider
  					added = true
  					continue
  				}
  				providers[i] = p
  			}
  			if !added {
  				providers = append(providers, provider)
  			}
  			v.Providers = providers
  			return
  		}
  		versions = append(versions, v)
  	}
  	versions = append(versions, &VagrantVersion{
  		Version:   version,
  		Providers: []*VagrantProvider{provider},
  	})
  	sort.Sort(sort.Reverse(versions))
  	m.Versions = make([]*VagrantVersion, 0, maxVersions)
  	for i := 0; i < len(versions) && i < maxVersions; i++ {
  		m.Versions = append(m.Versions, versions[i].(*VagrantVersion))
  	}
  }
docs: // Add adds a provider to the manifest.
  //
  // If the version is already in the manifest, the given provider either
  // replaces any existing provider with the same name, or is appended to
  // the existing list of providers for that version.
  //
  // If the version is not already in the manifest a new version is added
  // containing the provider.
  //
  // The number of versions in the manifest is capped at the value of maxVersions.