build: Update Go to v1.24.1 (#25249)

This commit is contained in:
James Rasell
2025-03-06 11:33:14 +01:00
committed by GitHub
parent 29c7b7ca44
commit 2eb35a4678
10 changed files with 13 additions and 48 deletions

3
.changelog/25249.txt Normal file
View File

@@ -0,0 +1,3 @@
```release-note:improvement
build: Updated Go to 1.24.1
```

View File

@@ -1 +1 @@
1.23.6
1.24.1

View File

@@ -47,7 +47,8 @@ linters-settings:
# exclude: /path/to/file.txt
govet:
# report about shadowed variables
check-shadowing: false
disable:
- shadow
gofmt:
# simplify code: gofmt with `-s` option, true by default
simplify: true
@@ -86,7 +87,6 @@ linters:
- durationcheck
# - errchkjson (todo)
# - errorlint (todo)
- exportloopref
- copyloopvar
- usestdlibvars
fast: false

View File

@@ -1,31 +0,0 @@
# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: BUSL-1.1
rules:
- id: loopclosure
patterns:
- pattern-inside: |
for $A, $B := range $C {
...
}
- pattern-inside: |
go func() {
...
}()
- pattern-not-inside: |
go func(..., $B, ...) {
...
}(..., $B, ...)
- pattern-not-inside: |
go func() {
...
for ... {
...
}
...
}()
- pattern: $B
message: Loop variable $B used inside goroutine
languages:
- go
severity: WARNING

View File

@@ -136,16 +136,16 @@ deps: ## Install build and development dependencies
go install github.com/hashicorp/go-msgpack/v2/codec/codecgen@v2.1.2
go install github.com/bufbuild/buf/cmd/buf@v0.36.0
go install github.com/hashicorp/go-changelog/cmd/changelog-build@latest
go install golang.org/x/tools/cmd/stringer@v0.18.0
go install golang.org/x/tools/cmd/stringer@v0.30.0
go install github.com/hashicorp/hc-install/cmd/hc-install@v0.9.0
go install github.com/shoenig/go-modtool@v0.2.0
.PHONY: lint-deps
lint-deps: ## Install linter dependencies
@echo "==> Updating linter dependencies..."
go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.61.0
go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.64.5
go install github.com/client9/misspell/cmd/misspell@v0.3.4
go install github.com/hashicorp/go-hclog/hclogvet@v0.2.0
go install github.com/hashicorp/go-hclog/hclogvet@feaf6d2ec20fd895e711195c99e3fde93a68afc5
.PHONY: git-hooks
git-dir = $(shell git rev-parse --git-dir)

View File

@@ -185,9 +185,6 @@ func ParseConfigFile(path string) (*Config, error) {
// Parse durations for Consul and Vault config blocks if provided.
for _, consulConfig := range c.Consuls {
// Capture consulConfig inside the loop so the parse duration function
// modifies the right configuration.
consulConfig := consulConfig
if consulConfig.ServiceIdentity != nil {
tds = append(tds, durationConversionMap{
@@ -209,9 +206,6 @@ func ParseConfigFile(path string) (*Config, error) {
}
for _, vaultConfig := range c.Vaults {
// Capture vaultConfig inside the loop so the parse duration function
// modifies the right configuration.
vaultConfig := vaultConfig
if vaultConfig.DefaultIdentity != nil {
tds = append(tds, durationConversionMap{

View File

@@ -148,7 +148,6 @@ func (c *JobStopCommand) Run(args []string) int {
var wg sync.WaitGroup
for _, jobID := range jobIDs {
jobID := jobID
wg.Add(1)
go func() {

View File

@@ -33,7 +33,7 @@ A development environment is supplied via Vagrant to make getting started easier
Developing without Vagrant
---
1. Install [Go 1.23.6+](https://golang.org/) *(Note: `gcc-go` is not supported)*
1. Install [Go 1.24.1+](https://golang.org/) *(Note: `gcc-go` is not supported)*
1. Clone this repo
```sh
$ git clone https://github.com/hashicorp/nomad.git

View File

@@ -21,7 +21,7 @@ case $(arch) in
esac
function install_go() {
local go_version="1.23.6"
local go_version="1.24.1"
local download="https://storage.googleapis.com/golang/go${go_version}.linux-${ARCH}.tar.gz"
if go version 2>&1 | grep -q "${go_version}"; then

View File

@@ -56,7 +56,7 @@ REPO_PATH="${TMP_WORKSPACE}/gopath/src/github.com/hashicorp/nomad"
mkdir -p "${TMP_WORKSPACE}/tmp"
install_go() {
local go_version="1.23.6"
local go_version="1.24.1"
local download=
download="https://storage.googleapis.com/golang/go${go_version}.darwin-amd64.tar.gz"