Skip to content

Commit 6968236

Browse files
committed
init
0 parents  commit 6968236

File tree

5 files changed

+1260
-0
lines changed

5 files changed

+1260
-0
lines changed

LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) Jetsung Chan <jetsungchan@gmail.com>
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

+144
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,144 @@
1+
# Golang
2+
3+
- Support **Linux / MacOS / FreeBSD**
4+
5+
English | [简体中文](./README_CN.md)
6+
7+
- **Golang Version Manager:** [gvm.sh](#golang-version-manager)
8+
- **Golang Install:** [install.sh](#golang-install)
9+
10+
---
11+
12+
# Golang Version Manager
13+
14+
## Install
15+
16+
```bash
17+
curl -fsL https://github.com/jetsung/golang-install/raw/main/gvm.sh | bash -s -- -i
18+
19+
# or
20+
git clone https://github.com/jetsung/golang-install.git
21+
cd golang-install
22+
./gvm.sh -i
23+
24+
# source $HOME/.zshrc
25+
# source $HOME/.bashrc
26+
27+
gvm version
28+
```
29+
30+
## Help
31+
32+
```bash
33+
# gvm -h
34+
35+
gvm 1.0.4
36+
Golang Version Manager
37+
38+
USAGE:
39+
gvm [OPTIONS] <SUBCOMMANDS>
40+
41+
OPTIONS:
42+
-h, --help
43+
Print help information
44+
45+
-i, --install
46+
Install Golang Version Manager
47+
48+
-u, --update
49+
Update Golang Version Manager
50+
51+
-v, --version
52+
Print Gvm version information
53+
54+
SUBCOMMANDS:
55+
current Print the current go version
56+
install [version] Install a new go version
57+
list List all locally installed go versions
58+
list-remote <more> List all remote go versions
59+
uninstall Uninstall a Go version
60+
use [version] Change Go version
61+
```
62+
63+
# Golang Install
64+
65+
The latest version of the golang is installed.
66+
67+
- Support custom **version**
68+
- Support custom **GOPATH**
69+
70+
**Notice**
71+
72+
- GOROOT: `$HOME/.go`
73+
- By default, the latest version of **go version** is installed, and the **GOPATH** directory is `$HOME/go`
74+
75+
## Installation
76+
77+
### Online
78+
79+
#### Default install
80+
81+
```sh
82+
curl -fsL https://raw.githubusercontent.com/jetsung/golang-install/main/install.sh | bash
83+
```
84+
85+
#### Custom version
86+
87+
- **MY_DIY_GO_VERSION** is a custom golang version, such as: `1.12.8`
88+
- **MY_DIY_GO_PATH** is a custom gopath, such as: `/home/myhome/go`
89+
90+
```sh
91+
curl -fsL https://raw.githubusercontent.com/jetsung/golang-install/main/install.sh | bash -s -- -v MY_DIY_GO_VERSION -p MY_DIY_GO_PATH
92+
```
93+
94+
### Offline
95+
96+
Save the script as a file name **install.sh**
97+
98+
```sh
99+
# default install
100+
bash install.sh
101+
102+
# customize
103+
bash install.sh -v 1.12.8 -p /home/myhome/go
104+
```
105+
106+
When you add executable permissions, you can customize the version and gopath.
107+
108+
```sh
109+
# add executable
110+
chmod +x install.sh
111+
112+
# default install
113+
./install.sh
114+
115+
# customize
116+
./install.sh -v 1.12.8 -p /home/myhome/go
117+
```
118+
119+
**Usage**
120+
./install.sh -h
121+
122+
```
123+
Go install
124+
125+
USAGE:
126+
install.sh [OPTIONS] <SUBCOMMANDS>
127+
128+
OPTIONS:
129+
-h, --help
130+
Print help information.
131+
132+
-p, --path
133+
Set GOPATH. (default: $HOME/go)
134+
135+
-r, --root
136+
Set GOROOT. (default: $HOME/.go)
137+
138+
-v, --version
139+
Set golang version.
140+
```
141+
142+
## License
143+
144+
This project is licensed under the [MIT license](./LICENSE).

README_CN.md

+144
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,144 @@
1+
# Go 语言
2+
3+
- 支持 **Linux / MacOS / FreeBSD** 等系统
4+
5+
[English](./README.md) | 简体中文
6+
7+
- **Golang Version Manager:** [gvm.sh](#go-语言版本管理)
8+
- **Golang Install:** [install.sh](#go-语言安装)
9+
10+
---
11+
12+
# Go 语言版本管理
13+
14+
## 安装
15+
16+
```bash
17+
curl -fsL https://framagit.org/jetsung/golang-install/-/raw/main/gvm.sh | bash -s -- -i
18+
19+
# 或者
20+
git clone https://framagit.org/jetsung/golang-install.git
21+
cd golang-install
22+
./gvm.sh -i
23+
24+
# source $HOME/.zshrc
25+
# source $HOME/.bashrc
26+
27+
gvm version
28+
```
29+
30+
## 帮助
31+
32+
```bash
33+
# gvm -h
34+
35+
gvm 1.0.4
36+
Golang Version Manager
37+
38+
USAGE:
39+
gvm [OPTIONS] <SUBCOMMANDS>
40+
41+
OPTIONS:
42+
-h, --help
43+
Print help information
44+
45+
-i, --install
46+
Install Golang Version Manager
47+
48+
-u, --update
49+
Update Golang Version Manager
50+
51+
-v, --version
52+
Print Gvm version information
53+
54+
SUBCOMMANDS:
55+
current Print the current go version
56+
install [version] Install a new go version
57+
list List all locally installed go versions
58+
list-remote <more> List all remote go versions
59+
uninstall Uninstall a Go version
60+
use [version] Change Go version
61+
```
62+
63+
# Go 语言安装
64+
65+
最新版 Go 语言一键安装脚本。
66+
67+
- 支持自定义**版本**
68+
- 支持自定义**GOPATH**
69+
70+
**注意**
71+
72+
- GOROOT: `$HOME/.go`
73+
- 默认安装最新版本的 **go version**, **GOPATH** 目录为 `$HOME/go`
74+
75+
## 安装
76+
77+
### 在线安装
78+
79+
#### 默认安装
80+
81+
```sh
82+
curl -fsL https://framagit.org/jetsung/golang-install/-/raw/main/install.sh | bash
83+
```
84+
85+
#### 自定义安装
86+
87+
- **MY_DIY_GO_VERSION** 是自定义版本号, 例如: `1.12.8`
88+
- **MY_DIY_GO_PATH** 是自定义版本号, 例如: `/home/myhome/go`
89+
90+
```sh
91+
curl -fsL https://framagit.org/jetsung/golang-install/-/raw/main/install.sh | bash -s -- -v MY_DIY_GO_VERSION -p MY_DIY_GO_PATH
92+
```
93+
94+
### 离线执行
95+
96+
保存脚本并且命名为 **install.sh**
97+
98+
```sh
99+
# 默认配置
100+
bash install.sh
101+
102+
# 自定义
103+
bash install.sh -v 1.12.8 -p /home/myhome/go
104+
```
105+
106+
脚本可执行权限,那么同时可以自定义 Go 版本和 GOPATH。
107+
108+
```sh
109+
# 添加可执行权限
110+
chmod +x install.sh
111+
112+
# 默认配置
113+
./install.sh
114+
115+
# 自定义
116+
./install.sh -v 1.12.8 -p /home/myhome/go
117+
```
118+
119+
**使用说明**
120+
121+
```
122+
Go install
123+
124+
USAGE:
125+
install.sh [OPTIONS] <SUBCOMMANDS>
126+
127+
OPTIONS:
128+
-h, --help
129+
Print help information.
130+
131+
-p, --path
132+
Set GOPATH. (default: $HOME/go)
133+
134+
-r, --root
135+
Set GOROOT. (default: $HOME/.go)
136+
137+
-v, --version
138+
Set golang version.
139+
140+
```
141+
142+
## License
143+
144+
This project is licensed under the [MIT license](./LICENSE).

0 commit comments

Comments
 (0)