Skip to content

Commit

Permalink
fix(bug): don't install already installed and active GOLANG version
Browse files Browse the repository at this point in the history
  • Loading branch information
ankitcharolia committed Aug 29, 2023
1 parent e69ddea commit b8b347a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit b8b347a

Please sign in to comment.