3 A proof-of-concept command-line installer for Go.
5 This installer is designed to both install Go as well as do the initial configuration
6 of setting up the right environment variables and paths.
8 It will install the Go distribution (tools & stdlib) to "/.go" inside your home directory by default.
10 It will setup "$HOME/go" as your GOPATH.
11 This is where third party libraries and apps will be installed as well as where you will write your Go code.
13 If Go is already installed via this installer it will upgrade it to the latest version of Go.
15 Currently the installer supports Windows, \*nix and macOS on x86 & x64.
16 It supports Bash and Zsh on all of these platforms as well as powershell & cmd.exe on Windows.
20 Windows Powershell/cmd.exe:
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`
24 Shell (Linux/macOS/Windows):
26 `curl -LO https://get.golang.org/$(uname)/go_installer && chmod +x go_installer && ./go_installer && rm go_installer`
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.
34 ## Development instructions
38 There are integration tests in [`main_test.go`](main_test.go). Please add more
41 #### On unix/linux with the Dockerfile
43 The Dockerfile automatically builds the binary, moves it to
44 `/usr/local/bin/getgo` and then unsets `$GOPATH` and removes all `$GOPATH` from
48 $ docker build --rm --force-rm -t getgo .
50 $ docker run --rm -it getgo bash
51 root@78425260fad0:~# getgo -v
52 Welcome to the Go installer!
53 Downloading Go version go1.8.3 to /usr/local/go
54 This may take a bit of time...
55 Adding "export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/go/bin" to /root/.bashrc
58 Adding "export GOPATH=/root/go" to /root/.bashrc
59 Adding "export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/go/bin:/root/go/bin" to /root/.bashrc
60 GOPATH has been setup!
61 root@78425260fad0:~# which go
63 root@78425260fad0:~# echo $GOPATH
65 root@78425260fad0:~# echo $PATH
66 /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/go/bin:/root/go/bin
69 ## Release instructions
71 To upload a new release of getgo, run `./make.bash && ./upload.bash`.