Created
March 30, 2020 01:39
-
-
Save unsafe9/dd7f80bb92d205d38e4d3aa62c9d9d77 to your computer and use it in GitHub Desktop.
open go terminal by version
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
if defined GVM_VERSION ( | |
echo ERROR: Cannot export on gvm terminal | |
exit /b | |
) | |
set GVM_VERSION=%1 | |
set GOROOT=C:\Go%1 | |
set GOPATH=E:\golang%1 | |
set PATH=%PATH%;%GOROOT%\bin;%GOPATH%\bin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
if "%1"=="now" goto current_version | |
if defined GVM_VERSION goto on_gvm | |
if "%1"=="help" goto installed_versions | |
if "%1"=="1.8.3" goto start_gvm | |
if "%1"=="1.9.7" goto start_gvm | |
if "%1"=="1.13.9" goto start_gvm | |
echo ERROR: Uninstalled or invalid golang version | |
exit /b | |
:current_version | |
if defined GVM_VERSION ( | |
echo %GVM_VERSION% | |
) else ( | |
echo ERROR : Not on gvm | |
) | |
exit /b | |
:installed_versions | |
echo installed golang version : 1.8.3, 1.9.7, 1.13.9 | |
exit /b | |
:on_gvm | |
echo ERROR: Cannot run on gvm terminal | |
exit /b | |
:start_gvm | |
call cmd /k "_gvm_export %1" | |
exit /b |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment