Skip to content

Commit

Permalink
Bumping the minimum Go version is now a minor change, not a major one. (
Browse files Browse the repository at this point in the history
  • Loading branch information
bobg authored Dec 24, 2023
1 parent 5eeabfa commit b862116
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions compare.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,18 +112,10 @@ func (c *comparer) compareMajor(older, newer map[string]*packages.Package) Resul
continue
}

newPkg := newer[pkgPath]
if newPkg != nil {
if oldMod, newMod := pkg.Module, newPkg.Module; oldMod != nil && newMod != nil {
if cmp := semver.Compare("v"+oldMod.GoVersion, "v"+newMod.GoVersion); cmp < 0 {
return rwrapf(Major, "minimum Go version changed from %s to %s", oldMod.GoVersion, newMod.GoVersion)
}
}
}

var (
topObjs = makeTopObjs(pkg)
newTopObjs map[string]types.Object
newPkg = newer[pkgPath]
)

for id, obj := range topObjs {
Expand Down Expand Up @@ -155,9 +147,17 @@ func (c *comparer) compareMinor(older, newer map[string]*packages.Package) Resul
continue
}

oldPkg := older[pkgPath]
if oldPkg != nil {
if oldMod, newMod := oldPkg.Module, pkg.Module; oldMod != nil && newMod != nil {
if cmp := semver.Compare("v"+oldMod.GoVersion, "v"+newMod.GoVersion); cmp < 0 {
return rwrapf(Minor, "minimum Go version changed from %s to %s", oldMod.GoVersion, newMod.GoVersion)
}
}
}

var (
topObjs = makeTopObjs(pkg)
oldPkg = older[pkgPath]
oldTopObjs map[string]types.Object
)

Expand Down
File renamed without changes.

0 comments on commit b862116

Please sign in to comment.