Skip to content

Commit

Permalink
switch to warning when replacing to lower version than require block
Browse files Browse the repository at this point in the history
Signed-off-by: hectorj2f <[email protected]>
  • Loading branch information
hectorj2f committed Feb 1, 2024
1 parent b03926c commit 31b91ee
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/update/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ func checkPackageValues(pkgVersions map[string]*types.Package, modFile *modfile.
}
if semver.IsValid(pkgVersions[replace.New.Path].Version) {
if semver.Compare(replace.New.Version, pkgVersions[replace.New.Path].Version) > 0 {
return fmt.Errorf("package %s with version '%s' is already at version %s", replace.New.Path, replace.New.Version, pkgVersions[replace.New.Path].Version)
fmt.Printf("WARNING: package %s with version '%s' is already at version %s", replace.New.Path, replace.New.Version, pkgVersions[replace.New.Path].Version)
}
} else {
fmt.Printf("Requesting pin to %s.\n This is not a valid SemVer, so skipping version check.\n", pkgVersions[replace.New.Path].Version)
Expand Down

0 comments on commit 31b91ee

Please sign in to comment.