Skip to content

Commit 07c5d30

Browse files
committed
docs: update docs for users
1 parent 1061e59 commit 07c5d30

File tree

1 file changed

+74
-35
lines changed

1 file changed

+74
-35
lines changed

README.md

+74-35
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22

33
[![Build Status](https://travis-ci.org/soulteary/gvm.svg?branch=master)](https://travis-ci.org/soulteary/gvm)
44

5-
By Josh Bussdieker (jbuss, jaja, jbussdieker) while working at [Moovweb](https://www.moovweb.com)
5+
GVM provides an interface to manage Go versions.
66

7-
Currently lovingly maintained by [Benjamin Knigge](https://github.com/BenKnigge)
7+
The current maintainer of the fork is [@soulteary](https://github.com/soulteary), fixed some issues that were not exposed in the past few years, **and supports Apple M1 devices**.
88

9-
Pull requests and other any other contributions would be very much appreciated.
9+
- Thanks to the original author of the program: By Josh Bussdieker (jbuss, jaja, jbussdieker) while working at [Moovweb](https://www.moovweb.com)
10+
- Thanks to previous project maintainers: [Benjamin Knigge](https://github.com/BenKnigge)
1011

11-
GVM provides an interface to manage Go versions.
1212

1313
Features
1414
========
@@ -30,15 +30,39 @@ Installing
3030

3131
To install:
3232

33-
curl -sSL https://github.com/soulteary/gvm/raw/master/binscripts/gvm-installer | bash
33+
```bash
34+
curl -sSL https://github.com/soulteary/gvm/raw/master/binscripts/gvm-installer | bash
35+
```
36+
37+
Or if you are using zsh just change `bash` with `zsh`.
38+
39+
40+
It is recommended to manually add the following content to `~/.bashrc` or `~/.zshrc` , then restart Terminal and use the `gvm` command.
3441

35-
Or if you are using zsh just change `bash` with `zsh`
42+
43+
```bash
44+
export GO111MODULE=on
45+
# set mirroring, if you need to
46+
export GOPROXY=https://goproxy.io,direct
47+
# or `export GOPROXY="https://goproxy.cn"`
48+
export GOPATH="$HOME/go"
49+
PATH="$GOPATH/bin:$PATH"
50+
# you can set as your own mirror
51+
# export GO_BINARY_BASE_URL=https://golang.google.cn/dl/
52+
[[ -s "$HOME/.gvm/scripts/gvm" ]] && source "$HOME/.gvm/scripts/gvm"
53+
export GOROOT_BOOTSTRAP=$GOROOT
54+
```
3655

3756
Installing Go
3857
=============
39-
gvm install go1.4
40-
gvm use go1.4 [--default]
41-
Once this is done Go will be in the path and ready to use. $GOROOT and $GOPATH are set automatically.
58+
59+
```bash
60+
gvm install go1.4
61+
gvm use go1.4 [--default]
62+
```
63+
64+
Once this is done Go will be in the path and ready to use.
65+
`$GOROOT` and `$GOPATH` are set automatically.
4266

4367
Additional options can be specified when installing Go:
4468

@@ -54,7 +78,7 @@ Additional options can be specified when installing Go:
5478
### A Note on Compiling Go 1.5+
5579
Go 1.5+ removed the C compilers from the toolchain and [replaced][compiler_note] them with one written in Go. Obviously, this creates a bootstrapping problem if you don't already have a working Go install. In order to compile Go 1.5+, make sure Go 1.4 is installed first.
5680

57-
```
81+
```bash
5882
gvm install go1.4 -B
5983
gvm use go1.4
6084
export GOROOT_BOOTSTRAP=$GOROOT
@@ -67,17 +91,23 @@ List Go Versions
6791
================
6892
To list all installed Go versions (The current version is prefixed with "=>"):
6993

70-
gvm list
94+
```bash
95+
gvm list
96+
```
7197

7298
To list all Go versions available for download:
7399

74-
gvm listall
100+
```bash
101+
gvm listall
102+
```
75103

76104
Uninstalling
77105
============
78106
To completely remove gvm and all installed Go versions and packages:
79107

80-
gvm implode
108+
```bash
109+
gvm implode
110+
```
81111

82112
If that doesn't work see the troubleshooting steps at the bottom of this page.
83113

@@ -86,7 +116,7 @@ Mac OS X Requirements
86116
* Install Mercurial from https://www.mercurial-scm.org/downloads
87117
* Install Xcode Command Line Tools from the App Store.
88118

89-
```
119+
```bash
90120
xcode-select --install
91121
brew update
92122
brew install mercurial
@@ -97,26 +127,33 @@ Linux Requirements
97127

98128
Debian/Ubuntu
99129
==================
100-
sudo apt-get install curl git mercurial make binutils bison gcc build-essential
130+
131+
```bash
132+
sudo apt-get install curl git mercurial make binutils bison gcc build-essential
133+
```
101134

102135
Redhat/Centos
103136
==================
104137

105-
sudo yum install curl
106-
sudo yum install git
107-
sudo yum install make
108-
sudo yum install bison
109-
sudo yum install gcc
110-
sudo yum install glibc-devel
138+
```bash
139+
sudo yum install curl
140+
sudo yum install git
141+
sudo yum install make
142+
sudo yum install bison
143+
sudo yum install gcc
144+
sudo yum install glibc-devel
145+
```
111146

112147
* Install Mercurial from http://pkgs.repoforge.org/mercurial/
113148

114149
FreeBSD Requirements
115150
====================
116151

117-
sudo pkg_add -r bash
118-
sudo pkg_add -r git
119-
sudo pkg_add -r mercurial
152+
```bash
153+
sudo pkg_add -r bash
154+
sudo pkg_add -r git
155+
sudo pkg_add -r mercurial
156+
```
120157

121158
Vendoring Native Code and Dependencies
122159
==================================================
@@ -151,17 +188,19 @@ system provides:
151188

152189
Recipe for success:
153190

154-
gvm use go1.1
155-
gvm pkgset use current-known-good
156-
# Let's assume that this includes some C headers and native libraries, which
157-
# Go's CGO facility wraps for us. Let's assume that these native
158-
# dependencies are at version V.
159-
gvm pkgset create trial-next-version
160-
# Let's assume that V+1 has come along and you want to safely trial it in
161-
# your workspace.
162-
gvm pkgset use trial-next-version
163-
# Do your work here replicating current-known-good from above, but install
164-
# V+1 into ${GVM_OVERLAY_PREFIX}.
191+
```bash
192+
gvm use go1.1
193+
gvm pkgset use current-known-good
194+
# Let's assume that this includes some C headers and native libraries, which
195+
# Go's CGO facility wraps for us. Let's assume that these native
196+
# dependencies are at version V.
197+
gvm pkgset create trial-next-version
198+
# Let's assume that V+1 has come along and you want to safely trial it in
199+
# your workspace.
200+
gvm pkgset use trial-next-version
201+
# Do your work here replicating current-known-good from above, but install
202+
# V+1 into ${GVM_OVERLAY_PREFIX}.
203+
```
165204

166205
See examples/native for a working example.
167206

0 commit comments

Comments
 (0)