Skip to content

Go

Go is a compiled, garbage collected programming language excellent at async, concurrent work

Install

  • Windows

    1. Download ZIP from https://go.dev/dl/ and save it to Downloads
    2. Set version for scripts
    powershell
    $version="1.23.2"
    1. Extract the downloaded archive
    powershell
    7z x -y ~/Downloads/go$version.windows-amd64.zip "-o$HOME/dotbin/extra/portable"
    1. Setup GOPATH
    powershell
    mkdir -p ~/dotbin/extra/portable/go/gopath
    $gopath=$env:USERPROFILE+"\dotbin\extra\portable\go\gopath"
    [System.Environment]::SetEnvironmentVariable('GOPATH',$gopath,"User")

    WARNING

    Currently, GOPATH is not added to PATH because I don't need to run any Go packages. This might change in the future

    1. Configure link
    powershell
    Add-Content -Path ~/dotbin/extra/portable/link -Value "go/bin/go.exe`ngo/bin/gofmt.exe"
    sudo dotbin-link
  • Arch Linux: Install the go package and make the portable package directory

    bash
    sudo pacman -Syu go
    mkdir -p ~/dotbin/extra/portable/go

    Then add the following to ~/.bashrc

    bash
    # Go
    export GOPATH=$HOME/dotbin/extra/portable/go/gopath

WARNING

Restart Shell after making the changes to environment variables!

Then verify the installtion with

powershell
go version