Skip to content

Commit

Permalink
rename MaxVersionModule to MaxVersion
Browse files Browse the repository at this point in the history
  • Loading branch information
icholy committed Jul 9, 2024
1 parent cf63f82 commit 9760c44
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions internal/modproxy/modproxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ type Module struct {
Versions []string
}

// MaxVersionModule returns the latest version of the module in the list.
// MaxVersion returns the latest version of the module in the list.
// If pre is false, pre-release versions will are excluded.
// Retracted versions are excluded.
func MaxVersionModule(mods []*Module, pre bool, r Retractions) (*Module, string) {
func MaxVersion(mods []*Module, pre bool, r Retractions) (*Module, string) {
for i := len(mods); i > 0; i-- {
mod := mods[i-1].Retract(r)
if max := mod.MaxVersion("", pre); max != "" {
Expand Down Expand Up @@ -199,14 +199,14 @@ func Latest(modpath string, cached, pre bool) (*Module, error) {
}
// find the retractions
var r Retractions
if mod, _ := MaxVersionModule(mods, false, nil); mod != nil {
if mod, _ := MaxVersion(mods, false, nil); mod != nil {
var err error
r, err = FetchRetractions(mod)
if err != nil {
return nil, err
}
}
mod, _ := MaxVersionModule(mods, pre, r)
mod, _ := MaxVersion(mods, pre, r)
if mod == nil {
return nil, ErrNoVersions
}
Expand Down

0 comments on commit 9760c44

Please sign in to comment.