Code Monkey home page Code Monkey logo

govm's Introduction

govm

govm是一个Linux、macOS、Windows下的命令行工具,可以提供一个便捷的多版本go环境的管理和切换。

main ls help

特性

  • 支持列出可供安装的go版本号
  • 支持列出已安装的go版本号
  • 支持在本地安装多个go版本
  • 支持卸载已安装的go版本
  • 支持在已安装的go版本之间自由切换
  • 支持在下载当前系统的指定版本的安装包

安装

  • 编译对应平台的二进制压缩包。

  • 将二进制文件移动至PATH环境变量目录下,如/usr/local/bin

  • 编辑shell环境配置文件(~/.bashrc~/.zshrc...)

    $ cat > ~/.bashrc <<EOF
    export GOROOT=~/.g/go
    export PATH=~/.g/go/bin:$PATH
    EOF
    $ source ~/.bashrc
  • windows环境自行类比

使用

查询当前可供安装的stable状态的go版本

$ govm ls-remote stable
1.11.9
1.12.4

安装目标go版本1.12.4

$ govm install 1.12.4
installed successfully
$ go version
go version go1.12.4 darwin/amd64

查询已安装的go版本

$ govm ls
1.12.4

查询可供安装的所有go版本

$ govm ls-remote
1
1.2.2
1.3
1.3.1
...    // 省略若干版本
1.11.7
1.11.8
1.11.9
1.12
1.12.1
1.12.2
1.12.3
1.12.4

安装目标go版本1.11.9

$ govm install 1.11.9
installed successfully
$ go version
go version go1.11.9 darwin/amd64

切换到另一个已安装的go版本

$ govm ls
1.11.9
1.12.4
$ govm use 1.12.4
go version go1.12.4 darwin/amd64

卸载一个已安装的go版本

govm uninstall 1.11.9
Uninstall successfully

使用的模块

感谢urfave/cliPerlbrew等工具提供的宝贵思路。

govm's People

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.