Skip to content

Commit f0395d8

Browse files
authored
feat: Updates to Go 1.21.3 (#1550)
* update to Go 1.21.3 * update doc * update linter * keep timeout in linter to avoid error: Timeout exceeded: try increasing it by passing --timeout option * adjust linter to use depguard v2 * apply feedback about using toolchain version * apply feedback to remove depguard linter * undo reformat * remove linters not being used because abandoned. WARN [runner] The linter 'varcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused. WARN [runner] The linter 'structcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused. WARN [runner] The linter 'deadcode' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused.
1 parent a7f7217 commit f0395d8

File tree

8 files changed

+76
-36
lines changed

8 files changed

+76
-36
lines changed

.github/workflows/code-health.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,8 @@ jobs:
6868
- name: golangci-lint
6969
uses: golangci/[email protected]
7070
with:
71-
version: v1.52.2
72-
args: --timeout 9m0s
71+
version: v1.55.0
72+
args: --timeout 10m
7373
website-lint:
7474
runs-on: ubuntu-latest
7575
steps:

.golangci.yml

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,6 @@ linters-settings:
4848
- name: redefines-builtin-id
4949
maligned:
5050
suggest-new: true
51-
depguard:
52-
list-type: blacklist
53-
packages:
54-
# logging is allowed only by logutils.Log, logrus
55-
# is allowed to use only in logutils package
56-
- github.com/sirupsen/logrus
5751
misspell:
5852
locale: US
5953
ignore-words:
@@ -72,15 +66,13 @@ linters-settings:
7266
settings:
7367
mnd:
7468
# don't include the "operation" and "assign"
75-
checks: [case,return]
69+
checks: [case, return]
7670
funlen:
7771
lines: 360
7872
statements: 120
7973
linters:
8074
disable-all: true
8175
enable:
82-
- deadcode
83-
- depguard
8476
- dogsled
8577
- errcheck
8678
- funlen
@@ -101,14 +93,16 @@ linters:
10193
- rowserrcheck
10294
- exportloopref
10395
- staticcheck
104-
- structcheck
10596
- stylecheck
10697
- typecheck
10798
- unconvert
10899
- unused
109-
- varcheck
110100
- whitespace
111101
# don't enable:
102+
# - deadcode
103+
# - varcheck
104+
# - structcheck
105+
# - depguard # Go linter that checks if package imports are in a list of acceptable packages [fast: true, auto-fix: false]
112106
# - gocyclo # we already have funlen lint
113107
# - dupl # we have a lot of duplicate test cases
114108
# - gochecknoinits # we need the init function for the provider
@@ -137,10 +131,10 @@ issues:
137131

138132
# Exclude some staticcheck messages
139133
- linters:
140-
- staticcheck
134+
- staticcheck
141135
text: "SA1019:" # d.GetOkExists is deprecated: usage is discouraged due to undefined behaviors and may be removed in a future version of the SDK
142136
- linters:
143-
- gocritic
137+
- gocritic
144138
text: "^hugeParam: req is heavy"
145139

146140
run:

.tool-versions

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
golang 1.20
1+
golang 1.21.3

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
### Prerequisite Tools
66

77
- [Git](https://git-scm.com/)
8-
- [Go (at least Go 1.20)](https://golang.org/dl/)
8+
- [Go (at least Go 1.21)](https://golang.org/dl/)
99

1010
### Environment
1111

GNUmakefile

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=v1.52.2
19+
GOLANGCI_VERSION=v1.55.0
2020

2121
export PATH := $(shell go env GOPATH)/bin:$(PATH)
2222
export SHELL := env PATH=$(PATH) /bin/bash
@@ -78,7 +78,7 @@ lint:
7878
tools: ## Install dev tools
7979
@echo "==> Installing dependencies..."
8080
go install github.com/client9/misspell/cmd/misspell@latest
81-
go install github.com/terraform-linters/tflint@v0.46.1
81+
go install github.com/terraform-linters/tflint@v0.48.0
8282
go install github.com/rhysd/actionlint/cmd/actionlint@latest
8383
go install golang.org/x/tools/go/analysis/passes/fieldalignment/cmd/fieldalignment@latest
8484
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(shell go env GOPATH)/bin $(GOLANGCI_VERSION)

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Feature requests can be submitted at https://feedback.mongodb.com/forums/924145-
1818

1919
## Requirements
2020
- [Terraform](https://www.terraform.io/downloads.html) 1.0+
21-
- [Go](https://golang.org/doc/install) 1.20 (to build the provider plugin)
21+
- [Go](https://golang.org/doc/install) 1.21 (to build the provider plugin)
2222

2323
## Using the Provider
2424

go.mod

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
module github.com/mongodb/terraform-provider-mongodbatlas
22

3-
go 1.20
3+
go 1.21
4+
5+
toolchain go1.21.3
46

57
require (
68
github.com/aws/aws-sdk-go v1.46.0
@@ -34,7 +36,7 @@ require (
3436
cloud.google.com/go/compute v1.19.1 // indirect
3537
cloud.google.com/go/compute/metadata v0.2.3 // indirect
3638
cloud.google.com/go/iam v0.13.0 // indirect
37-
cloud.google.com/go/storage v1.28.1 // indirect
39+
cloud.google.com/go/storage v1.29.0 // indirect
3840
github.com/Masterminds/goutils v1.1.1 // indirect
3941
github.com/Masterminds/semver/v3 v3.1.1 // indirect
4042
github.com/Masterminds/sprig/v3 v3.2.1 // indirect
@@ -44,7 +46,7 @@ require (
4446
github.com/armon/go-radix v1.0.0 // indirect
4547
github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d // indirect
4648
github.com/bgentry/speakeasy v0.1.0 // indirect
47-
github.com/boombuler/barcode v1.0.1-0.20190219062509-6c824513bacc // indirect
49+
github.com/boombuler/barcode v1.0.1 // indirect
4850
github.com/cloudflare/circl v1.3.3 // indirect
4951
github.com/cpuguy83/go-md2man/v2 v2.0.0 // indirect
5052
github.com/davecgh/go-spew v1.1.1 // indirect
@@ -78,6 +80,7 @@ require (
7880
github.com/hashicorp/go-uuid v1.0.3 // indirect
7981
github.com/hashicorp/go-version v1.6.0 // indirect
8082
github.com/hashicorp/hc-install v0.6.0 // indirect
83+
github.com/hashicorp/hcl v1.0.0 // indirect
8184
github.com/hashicorp/logutils v1.0.0 // indirect
8285
github.com/hashicorp/terraform-exec v0.19.0 // indirect
8386
github.com/hashicorp/terraform-json v0.17.1 // indirect
@@ -93,7 +96,7 @@ require (
9396
github.com/klauspost/compress v1.15.11 // indirect
9497
github.com/mailru/easyjson v0.7.7 // indirect
9598
github.com/mattn/go-colorable v0.1.12 // indirect
96-
github.com/mattn/go-isatty v0.0.14 // indirect
99+
github.com/mattn/go-isatty v0.0.16 // indirect
97100
github.com/mattn/go-zglob v0.0.2-0.20190814121620-e3c945676326 // indirect
98101
github.com/mitchellh/cli v1.1.5 // indirect
99102
github.com/mitchellh/copystructure v1.2.0 // indirect
@@ -112,9 +115,9 @@ require (
112115
github.com/pquerna/otp v1.3.0 // indirect
113116
github.com/russross/blackfriday/v2 v2.1.0 // indirect
114117
github.com/shopspring/decimal v1.2.0 // indirect
115-
github.com/spf13/afero v1.2.2 // indirect
118+
github.com/spf13/afero v1.9.2 // indirect
116119
github.com/spf13/pflag v1.0.5 // indirect
117-
github.com/stretchr/testify v1.8.1 // indirect
120+
github.com/stretchr/testify v1.8.3 // indirect
118121
github.com/tmccombs/hcl2json v0.3.3 // indirect
119122
github.com/ulikunitz/xz v0.5.10 // indirect
120123
github.com/urfave/cli v1.22.2 // indirect
@@ -131,7 +134,7 @@ require (
131134
golang.org/x/sys v0.13.0 // indirect
132135
golang.org/x/term v0.13.0 // indirect
133136
golang.org/x/text v0.13.0 // indirect
134-
golang.org/x/time v0.0.0-20220210224613-90d013bbcef8 // indirect
137+
golang.org/x/time v0.3.0 // indirect
135138
golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect
136139
google.golang.org/api v0.114.0 // indirect
137140
google.golang.org/appengine v1.6.7 // indirect

0 commit comments

Comments
 (0)