GoPLS Viewer

Home|gopls/cmd/getgo/README.md
1# getgo
2
3A proof-of-concept command-line installer for Go.
4
5This installer is designed to both install Go as well as do the initial configuration
6of setting up the right environment variables and paths.
7
8It will install the Go distribution (tools & stdlib) to "/.go" inside your home directory by default.
9
10It will setup "$HOME/go" as your GOPATH.
11This is where third party libraries and apps will be installed as well as where you will write your Go code.
12
13If Go is already installed via this installer it will upgrade it to the latest version of Go.
14
15Currently the installer supports Windows, \*nix and macOS on x86 & x64.
16It supports Bash and Zsh on all of these platforms as well as powershell & cmd.exe on Windows.
17
18## Usage
19
20Windows Powershell/cmd.exe:
21
22`(New-Object System.Net.WebClient).DownloadFile('https://get.golang.org/installer.exe', 'installer.exe'); Start-Process -Wait -NonewWindow installer.exe; Remove-Item installer.exe`
23
24Shell (Linux/macOS/Windows):
25
26`curl -LO https://get.golang.org/$(uname)/go_installer && chmod +x go_installer && ./go_installer && rm go_installer`
27
28## To Do
29
30* Check if Go is already installed (via a different method) and update it in place or at least notify the user
31* Lots of testing. It's only had limited testing so far.
32* Add support for additional shells.
33
34## Development instructions
35
36### Testing
37
38There are integration tests in [`main_test.go`](main_test.go). Please add more
39tests there.
40
41#### On unix/linux with the Dockerfile
42
43The Dockerfile automatically builds the binary, moves it to
44`/usr/local/bin/getgo` and then unsets `$GOPATH` and removes all `$GOPATH` from
45`$PATH`.
46
47```bash
48$ docker build --rm --force-rm -t getgo .
49...
50$ docker run --rm -it getgo bash
51root@78425260fad0:~# getgo -v
52Welcome to the Go installer!
53Downloading Go version go1.8.3 to /usr/local/go
54This may take a bit of time...
55Adding "export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/go/bin" to /root/.bashrc
56Downloaded!
57Setting up GOPATH
58Adding "export GOPATH=/root/go" to /root/.bashrc
59Adding "export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/go/bin:/root/go/bin" to /root/.bashrc
60GOPATH has been setup!
61root@78425260fad0:~# which go
62/usr/local/go/bin/go
63root@78425260fad0:~# echo $GOPATH
64/root/go
65root@78425260fad0:~# echo $PATH
66/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/go/bin:/root/go/bin
67```
68
69## Release instructions
70
71To upload a new release of getgo, run `./make.bash && ./upload.bash`.
72
MembersX
Members
X