// updateEnclosure finds all necessary dependency updates, updating the given VersionEnclosure and VersionBumps. updateEnclosure
// returns a mapping between modules and a list of that module's dependencies that must be updated to the latest version.
// updateEnclosure also creates change metadata for the dependency updates.
updateEnclosure finds all necessary dependency updates, updating the given VersionEnclosure and VersionBumps. updateEnclosure
returns a mapping between modules and a list of that module's dependencies that must be updated to the latest version.
updateEnclosure also creates change metadata for the dependency updates.
// updateEnclosure finds all necessary dependency updates updating the given VersionEnclosure and VersionBumps . updateEnclosure // returns a mapping between modules and a list of that module ' s dependencies that must be updated to the latest version . // updateEnclosure also creates change metadata for the dependency updates .
func (r *Repository) updateEnclosure(enc *VersionEnclosure, bumps map[string]VersionBump) (map[string][]string, error) {
	mods, err := r.Modules()
	if err != nil {
		return nil, fmt.Errorf("couldn't resolve dependencies: %v", err)
	}
	depGraph, err := moduleGraph(r.golist, mods)
	if err != nil {
		return nil, err
	}
	updates := depGraph.dependencyUpdates(AffectedModules(r.Metadata.Changes))
	if len(updates) == 0 {
		return nil, nil
	}
	var depMods []string
	for m := range updates {
		if _, ok := bumps[m]; !ok {
			depMods = append(depMods, m)
			bumps[m], err = enc.bump(m, PatchBump)
			if err != nil {
				return nil, err
			}
		}
	}
	err = r.Metadata.addDependencyUpdateChange(depMods)
	if err != nil {
		return nil, err
	}
	return updates, nil
}
func ( r * Repository ) updateEnclosure ( enc * VersionEnclosure , bumps map [ string ] VersionBump ) ( map [ string ] [ ] string , error ) { mods , err := r . Modules ( ) if err != nil { return nil , fmt . Errorf ( " " , err ) } depGraph , err := moduleGraph ( r . golist , mods ) if err != nil { return nil , err } updates := depGraph . dependencyUpdates ( AffectedModules ( r . Metadata . Changes ) ) if len ( updates ) == 0 { return nil , nil } var depMods [ ] string for m := range updates { if _ , ok := bumps [ m ] ; ! ok { depMods = append ( depMods , m ) bumps [ m ] , err = enc . bump ( m , PatchBump ) if err != nil { return nil , err } } } err = r . Metadata . addDependencyUpdateChange ( depMods ) if err != nil { return nil , err } return updates , nil }
updateEnclosure finds all necessary dependency updates, updating the given VersionEnclosure and VersionBumps.
updateEnclosure finds all necessary dependency updates updating the given VersionEnclosure and VersionBumps .