MCPcopy Create free account
hub / github.com/MertJSX/folderhost / isNewerVersion

Function isNewerVersion

utils/version_checker.go:45–75  ·  view source on GitHub ↗
(current, latest string)

Source from the content-addressed store, hash-verified

43}
44
45func isNewerVersion(current, latest string) bool {
46
47 currentYear, currentMonth, currentRelease, err := parseVersion(current)
48 if err != nil {
49 return false
50 }
51
52 latestYear, latestMonth, latestRelease, err := parseVersion(latest)
53 if err != nil {
54 return false
55 }
56
57 if latestYear > currentYear {
58
59 return true
60 }
61 if latestYear < currentYear {
62
63 return false
64 }
65
66 if latestMonth > currentMonth {
67 return true
68 }
69 if latestMonth < currentMonth {
70
71 return false
72 }
73
74 return latestRelease > currentRelease
75}
76
77func checkForUpdates(currentVersion string) (bool, string) {
78 client := http.Client{

Callers 1

checkForUpdatesFunction · 0.85

Calls 1

parseVersionFunction · 0.85

Tested by

no test coverage detected