From b8b347a52787804872fbbc84aaa4c518a989bb4c Mon Sep 17 00:00:00 2001 From: Ankit Charolia Date: Tue, 29 Aug 2023 19:11:01 +0200 Subject: [PATCH] fix(bug): don't install already installed and active GOLANG version --- main.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/main.go b/main.go index 831b70b..9f51e04 100755 --- a/main.go +++ b/main.go @@ -105,11 +105,12 @@ func listRemoteVersions() { } func installGoVersion(version string) { - if isInstalled(version) { + activeVersion := getCurrentGoVersion() + if isInstalled(version) || version == activeVersion { greenColor := "\033[32m" resetColor := "\033[0m" fmt.Printf("%sGo version %s is already installed.%s\n", greenColor, version, resetColor) - return + os.Exit(0) } // Install the specific Go version