Skip to content

Commit 35f72f6

Browse files
edslocombraxod502
andauthored
use up-to-date golang (#218)
While running a full `make fmt-build`, I got some failures with installer scripts for golang formatters. This fixes the problem by installing an up-to-date golang instead of the version available in ubuntu 20.04. The ppa used here, `longsleep/golang-backports` is [recommended](https://github.com/golang/go/wiki/Ubuntu) by the Go project. --------- Co-authored-by: Radon Rosborough <[email protected]>
1 parent afa0e54 commit 35f72f6

File tree

3 files changed

+8
-9
lines changed

3 files changed

+8
-9
lines changed

test/formatters/install-common.bash

+3-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ set -euxo pipefail
44

55
export DEBIAN_FRONTEND=noninteractive
66
apt-get update
7-
apt-get install -y ca-certificates curl gnupg lsb-release
7+
apt-get install -y ca-certificates curl gnupg lsb-release software-properties-common
88

99
curl -fsSL https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add -
1010

@@ -15,6 +15,8 @@ tee -a /etc/apt/sources.list.d/nodejs.list >/dev/null <<EOF
1515
deb [arch=amd64] https://deb.nodesource.com/${node_repo} ${ubuntu_name} main
1616
EOF
1717

18+
add-apt-repository -n ppa:longsleep/golang-backports
19+
1820
apt-get update
1921

2022
packages="
+3-6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
# Require at least version 1.17 of go
2-
# https://github.com/mvdan/gofumpt/issues/231
3-
curl -OL https://golang.org/dl/go1.19.3.linux-amd64.tar.gz
4-
sudo tar -C /usr/local -xvf go1.19.3.linux-amd64.tar.gz
5-
/usr/local/go/bin/go install mvdan.cc/gofumpt@latest
6-
cp -L "$HOME/go/bin/gofumpt" /usr/local/bin/
1+
apt-get install -y golang-go
2+
go install mvdan.cc/gofumpt@latest
3+
cp -L "$HOME/go/bin/gofumpt" /usr/local/bin/
+2-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
apt-get install -y golang-go
2-
go get -u golang.org/x/tools/cmd/goimports
3-
cp -L "$HOME/go/bin/goimports" /usr/local/bin/
2+
go install golang.org/x/tools/cmd/goimports@latest
3+
cp -L "$HOME/go/bin/goimports" /usr/local/bin/

0 commit comments

Comments
 (0)