Skip to content

Commit 0de42db

Browse files
authored
chore: Update to Go 1.24.6 and Go linter to 2.3.1 (#3579)
1 parent 8dcf547 commit 0de42db

File tree

7 files changed

+11
-10
lines changed

7 files changed

+11
-10
lines changed

.github/workflows/code-health.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ jobs:
5757
- name: golangci-lint
5858
uses: golangci/golangci-lint-action@4afd733a84b1f43292c63897423277bb7f4313a9
5959
with:
60-
version: v2.1.6 # Also update GOLANGCI_VERSION variable in GNUmakefile when updating this version
60+
version: v2.3.1 # Also update GOLANGCI_VERSION variable in GNUmakefile when updating this version
6161
- name: actionlint
6262
run: |
6363
make tools

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ GITTAG=$(shell git describe --always --tags)
1616
VERSION=$(GITTAG:v%=%)
1717
LINKER_FLAGS=-s -w -X 'github.com/mongodb/terraform-provider-mongodbatlas/version.ProviderVersion=${VERSION}'
1818

19-
GOLANGCI_VERSION=v2.1.6 # Also update golangci-lint GH action in code-health.yml when updating this version
19+
GOLANGCI_VERSION=v2.3.1 # Also update golangci-lint GH action in code-health.yml when updating this version
2020

2121
export PATH := $(shell go env GOPATH)/bin:$(PATH)
2222
export SHELL := env PATH=$(PATH) /bin/bash
@@ -236,4 +236,4 @@ upload-sbom: ## Upload SBOM
236236

237237
.PHONY: augment-sbom
238238
augment-sbom: ## Augment SBOM
239-
./scripts/compliance/augment-sbom.sh
239+
./scripts/compliance/augment-sbom.sh

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module github.com/mongodb/terraform-provider-mongodbatlas
22

3-
go 1.24.5
3+
go 1.24.6
44

55
require (
66
github.com/andygrunwald/go-jira/v2 v2.0.0-20240116150243-50d59fe116d6

internal/serviceapi/clusterapi/resource_schema.go

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

internal/serviceapi/projectapi/resource_schema.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

internal/testutil/clean/org_clean_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ func TestCleanProjectAndClusters(t *testing.T) {
142142
})
143143
}
144144
t.Cleanup(func() {
145-
projectsAfter := readAllProjects(context.Background(), t, client) //nolint:usetesting // reason: using context.Background() here intentionally because t.Context() is canceled at cleanup
145+
projectsAfter := readAllProjects(context.Background(), t, client) // reason: using context.Background() here intentionally because t.Context() is canceled at cleanup
146146
t.Logf("SUMMARY\nProjects changed from %d to %d\ndelete_errors=%d\nempty_project_count=%d\nDRY_RUN=%t", projectsBefore, len(projectsAfter), deleteErrors, emptyProjectCount, dryRun)
147147
})
148148
}

tools/codegen/main.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package main
22

33
import (
4+
"context"
45
"fmt"
56
"log"
67
"os"
@@ -75,12 +76,12 @@ func writeToFile(fileName, content string) error {
7576

7677
// formatGoFile runs goimports and fieldalignment on the specified Go file
7778
func formatGoFile(filePath string) {
78-
goimportsCmd := exec.Command("goimports", "-w", filePath)
79+
goimportsCmd := exec.CommandContext(context.Background(), "goimports", "-w", filePath)
7980
if output, err := goimportsCmd.CombinedOutput(); err != nil {
8081
log.Printf("warning: goimports failed for %s: %v\nOutput: %s", filePath, err, output)
8182
}
8283

83-
fieldalignmentCmd := exec.Command("fieldalignment", "-fix", filePath)
84+
fieldalignmentCmd := exec.CommandContext(context.Background(), "fieldalignment", "-fix", filePath)
8485
if output, err := fieldalignmentCmd.CombinedOutput(); err != nil {
8586
log.Printf("warning: fieldalignment failed for %s: %v\nOutput: %s", filePath, err, output)
8687
}

0 commit comments

Comments
 (0)