Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Specify golang patch version in go.mod #2938

Merged
merged 2 commits into from
Apr 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# Changes to the minimum golang version must also be replicated in
# scripts/build_avalanche.sh
# tests/antithesis/Dockerfile.node
# tests/antithesis/Dockerfile.workload
# Dockerfile (here)
Expand Down
5 changes: 2 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
module github.com/ava-labs/avalanchego

// Changes to the minimum golang version must also be replicated in
// scripts/build_avalanche.sh
// tests/antithesis/Dockerfile.node
// tests/antithesis/Dockerfile.workload
// Dockerfile
// README.md
// go.mod (here, only major.minor can be specified)
go 1.21
// go.mod (here)
go 1.21.9

require (
github.com/DataDog/zstd v1.5.2
Expand Down
31 changes: 0 additions & 31 deletions scripts/build_avalanche.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,37 +22,6 @@ while getopts 'r' flag; do
esac
done

# Changes to the minimum golang version must also be replicated in
# scripts/build_avalanche.sh (here)
# tests/antithesis/Dockerfile.node
# tests/antithesis/Dockerfile.workload
# Dockerfile
# CONTRIBUTING.md
# README.md
# go.mod
go_version_minimum="1.21.9"

go_version() {
go version | sed -nE -e 's/[^0-9.]+([0-9.]+).+/\1/p'
}

version_lt() {
# Return true if $1 is a lower version than than $2,
local ver1=$1
local ver2=$2
# Reverse sort the versions, if the 1st item != ver1 then ver1 < ver2
if [[ $(echo -e -n "$ver1\n$ver2\n" | sort -rV | head -n1) != "$ver1" ]]; then
return 0
else
return 1
fi
}

if version_lt "$(go_version)" "$go_version_minimum"; then
echo "AvalancheGo requires Go >= $go_version_minimum, Go $(go_version) found." >&2
exit 1
fi

# Avalanchego root folder
AVALANCHE_PATH=$( cd "$( dirname "${BASH_SOURCE[0]}" )"; cd .. && pwd )
# Load the constants
Expand Down
2 changes: 1 addition & 1 deletion tests/antithesis/Dockerfile.node
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
FROM docker.io/antithesishq/go-instrumentor AS instrumentor

# Changes to the minimum golang version must also be replicated in
# scripts/build_avalanche.sh
# tests/antithesis/Dockerfile.node (here)
# tests/antithesis/Dockerfile.workload
# Dockerfile
# README.md
# go.mod
Expand Down
1 change: 0 additions & 1 deletion tests/antithesis/Dockerfile.workload
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# Changes to the minimum golang version must also be replicated in
# scripts/build_avalanche.sh
# tests/antithesis/Dockerfile.node
# tests/antithesis/Dockerfile.workload (here)
# Dockerfile
Expand Down
Loading