Skip to content

Instantly share code, notes, and snippets.

@gwillem
Created November 24, 2022 10:20
Show Gist options
  • Save gwillem/f2ce184456d431291fccca682a183711 to your computer and use it in GitHub Desktop.
Save gwillem/f2ce184456d431291fccca682a183711 to your computer and use it in GitHub Desktop.

Revisions

  1. gwillem created this gist Nov 24, 2022.
    13 changes: 13 additions & 0 deletions go.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,13 @@
    #!/bin/bash

    set -e

    ver=$(curl -Ls https://golang.org/VERSION?m=text)
    dst=/opt/go-$ver

    sudo mkdir -p $dst

    curl -Ls "https://dl.google.com/go/$ver.linux-$(dpkg --print-architecture).tar.gz" -o - | sudo tar -xz --strip-components=1 -C $dst

    sudo rm -f /opt/go
    sudo ln -sf go-$ver /opt/go