Skip to content

Commit 8f1e5aa

Browse files
jorgenptdanbrakeley
authored andcommitted
Bump required Go version to 1.19 and check in setup.sh
`encoding.binary.BigEndian.AppendUint32` was only added in 1.19, so bump the required version to that.
1 parent a2dbb8d commit 8f1e5aa

2 files changed

Lines changed: 14 additions & 3 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ When it is done, there will be a changelist that must be submitted by hand, givi
6969
## Development setup
7070

7171
- Ensure you have all the [Runtime requirements](#runtime-requirements)
72-
- Ensure you have a [recent version of Go (1.17+)](https://go.dev/dl/)
72+
- Ensure you have a [recent version of Go (1.19+)](https://go.dev/dl/)
7373
- Ensure that $GOPATH/bin is added to your $PATH environment variable.
7474
- To run all the tests, you'll want to have Docker installed
7575
- On Windows and Mac, you'll want [Docker Desktop](https://www.docker.com/products/docker-desktop)

scripts/setup.sh

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,30 @@
11
#!/bin/bash -e
2+
required_minor_version=19
3+
24
cd $(dirname "$0")
35

4-
echo "Checking for go..."
6+
echo "Checking for go v1.$required_minor_version..."
57
if ! command -v go &> /dev/null
68
then
79
echo "Could not find go. Make sure it is installed and in your path."
810
echo "https://golang.org/dl/"
911
exit 1
1012
fi
1113

14+
go_version=$(go version | awk '{print $3}' | sed 's/^go//')
15+
major_version=$(echo "$go_version" | cut -f1 -d.)
16+
minor_version=$(echo "$go_version" | cut -f2 -d.)
17+
if [[ "$major_version" -lt 1 || ( "$major_version" -eq 1 && "$minor_version" -lt "$required_minor_version" ) ]]; then
18+
echo "Need go version 1.$required_minor_version, you have $go_version. Please upgrade."
19+
echo "https://golang.org/dl/"
20+
exit 1
21+
fi
22+
1223
echo "Checking for mage..."
1324
if ! command -v mage &> /dev/null
1425
then
1526
echo "Could not find mage. Installing..."
1627
./reinstall-mage.sh
1728
fi
1829

19-
echo "All dependancies are installed."
30+
echo "All dependencies are installed."

0 commit comments

Comments
 (0)