Returns true if the latest version has a higher major or minor number than the current version. If you don't want to force an update, you can increment the patch number instead.
(current string, latest string)
| 62 | // number than the current version. If you don't want to force |
| 63 | // an update, you can increment the patch number instead. |
| 64 | func isUpdateRequired(current string, latest string) bool { |
| 65 | latestMajorMinor := semver.MajorMinor(latest) |
| 66 | currentMajorMinor := semver.MajorMinor(current) |
| 67 | return semver.Compare(currentMajorMinor, latestMajorMinor) < 0 |
| 68 | } |
| 69 | |
| 70 | func getLatestVersion() (string, error) { |
| 71 | goproxyDefault := "https://proxy.golang.org" |