From c75d7ead7a5a7ed4ca53b2ba490b25f0f640555f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20J=2E=20Nu=C3=B1ez=20Madrazo?= Date: Thu, 4 Jan 2024 14:41:20 +0000 Subject: [PATCH] Refactor version check logic in common.go MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Alejandro J. Nuñez Madrazo --- common/common.go | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/common/common.go b/common/common.go index 08793895..1fcb83d8 100644 --- a/common/common.go +++ b/common/common.go @@ -36,9 +36,13 @@ func GithubClient() *github.Client { func CheckVersionUpdate() { ghClient := GithubClient() res, skip := VersionCheck(ghClient) - if !skip { - if res.TagName != nil && *res.TagName != VersionCli { - fmt.Printf("A newer version (%s) is available, please upgrade with \"civo update\"\n", *res.TagName) + + // Check if the version is different from the one in the binary + if res.TagName != nil && *res.TagName != fmt.Sprintf("v%s", VersionCli) { + if !skip { + if res.TagName != nil && *res.TagName != VersionCli { + fmt.Printf("A newer version (%s) is available, please upgrade with \"civo update\"\n", *res.TagName) + } } } }