Skip to content

Commit dd5b0e3

Browse files
authored
Update CI to Go 1.19 to resolve linter build failures. (#1177)
1 parent 4f06ad2 commit dd5b0e3

File tree

6 files changed

+44
-69
lines changed

6 files changed

+44
-69
lines changed

.evergreen/config.yml

Lines changed: 34 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -2112,6 +2112,7 @@ axes:
21122112
VERSION: "latest"
21132113

21142114
# OSes that require >= 3.2 for SSL
2115+
# TODO(GODRIVER-2754): Update Windows to VS2019 and update Go to 1.19.
21152116
- id: os-ssl-32
21162117
display_name: OS
21172118
values:
@@ -2123,19 +2124,20 @@ axes:
21232124
GCC_PATH: "/cygdrive/c/ProgramData/chocolatey/lib/mingw/tools/install/mingw64/bin"
21242125
GO_DIST: "C:\\golang\\go1.18"
21252126
VENV_BIN_DIR: "Scripts"
2126-
- id: "ubuntu1604-64-go-1-18"
2127+
- id: "ubuntu1604-64-go-1-19"
21272128
display_name: "Ubuntu 16.04"
21282129
run_on: ubuntu1604-build
21292130
variables:
2130-
GO_DIST: "/opt/golang/go1.18"
2131-
- id: "osx-go-1-18"
2131+
GO_DIST: "/opt/golang/go1.19"
2132+
- id: "macos11-go-1-19"
21322133
display_name: "MacOS 11.0"
21332134
run_on: macos-1100
21342135
batchtime: 1440 # Run at most once per 24 hours.
21352136
variables:
2136-
GO_DIST: "/opt/golang/go1.18"
2137+
GO_DIST: "/opt/golang/go1.19"
21372138

21382139
# OSes that require >= 4.0 for SSL
2140+
# TODO(GODRIVER-2754): Update Windows to VS2019 and update Go to 1.19.
21392141
- id: os-ssl-40
21402142
display_name: OS
21412143
values:
@@ -2147,50 +2149,51 @@ axes:
21472149
GCC_PATH: "/cygdrive/c/ProgramData/chocolatey/lib/mingw/tools/install/mingw64/bin"
21482150
GO_DIST: "C:\\golang\\go1.18"
21492151
VENV_BIN_DIR: "Scripts"
2150-
- id: "ubuntu1804-64-go-1-18"
2152+
- id: "ubuntu1804-64-go-1-19"
21512153
display_name: "Ubuntu 18.04"
21522154
run_on: ubuntu1804-build
21532155
variables:
2154-
GO_DIST: "/opt/golang/go1.18"
2155-
- id: "osx-go-1-18"
2156+
GO_DIST: "/opt/golang/go1.19"
2157+
- id: "macos11-go-1-19"
21562158
display_name: "MacOS 11.0"
21572159
run_on: macos-1100
21582160
batchtime: 1440 # Run at most once per 24 hours.
21592161
variables:
2160-
GO_DIST: "/opt/golang/go1.18"
2162+
GO_DIST: "/opt/golang/go1.19"
21612163

21622164
# OCSP linux tasks need to run against this OS since stapling is disabled on Ubuntu 18.04 (SERVER-51364)
21632165
- id: ocsp-rhel-70
21642166
display_name: OS
21652167
values:
2166-
- id: "rhel70-go-1-18"
2168+
- id: "rhel70-go-1-19"
21672169
display_name: "RHEL 7.0"
21682170
run_on: rhel70-build
21692171
variables:
2170-
GO_DIST: "/opt/golang/go1.18"
2172+
GO_DIST: "/opt/golang/go1.19"
21712173

2174+
# TODO(GODRIVER-2754): Update Windows to VS2019 and update Go to 1.19.
21722175
- id: os-aws-auth
21732176
display_name: OS
21742177
values:
2175-
- id: "windows-64-vsMulti-small-go-1-18"
2178+
- id: "windows-64-vs2017-small-go-1-19"
21762179
display_name: "Windows 64-bit"
21772180
run_on:
2178-
- windows-64-vsMulti-small
2181+
- windows-64-vs2017-small
21792182
variables:
21802183
GCC_PATH: "/cygdrive/c/ProgramData/chocolatey/lib/mingw/tools/install/mingw64/bin"
21812184
GO_DIST: "C:\\golang\\go1.18"
21822185
SKIP_ECS_AUTH_TEST: true
2183-
- id: "ubuntu1804-64-go-1-18"
2186+
- id: "ubuntu1804-64-go-1-19"
21842187
display_name: "Ubuntu 18.04"
21852188
run_on: ubuntu1804-test
21862189
variables:
2187-
GO_DIST: "/opt/golang/go1.18"
2188-
- id: "osx-go-1-18"
2190+
GO_DIST: "/opt/golang/go1.19"
2191+
- id: "macos11-go-1-19"
21892192
display_name: "MacOS 11.0"
21902193
run_on: macos-1100
21912194
batchtime: 1440 # Run at most once per 24 hours.
21922195
variables:
2193-
GO_DIST: "/opt/golang/go1.18"
2196+
GO_DIST: "/opt/golang/go1.19"
21942197
SKIP_ECS_AUTH_TEST: true
21952198
SKIP_EC2_AUTH_TEST: true
21962199

@@ -2338,7 +2341,7 @@ buildvariants:
23382341
run_on:
23392342
- ubuntu1804-build
23402343
expansions:
2341-
GO_DIST: "/opt/golang/go1.18"
2344+
GO_DIST: "/opt/golang/go1.19"
23422345
tasks:
23432346
- name: ".static-analysis"
23442347

@@ -2347,7 +2350,7 @@ buildvariants:
23472350
run_on:
23482351
- ubuntu1804-build
23492352
expansions:
2350-
GO_DIST: "/opt/golang/go1.18"
2353+
GO_DIST: "/opt/golang/go1.19"
23512354
tasks:
23522355
- name: ".performance"
23532356

@@ -2356,7 +2359,7 @@ buildvariants:
23562359
run_on:
23572360
- ubuntu1804-test
23582361
expansions:
2359-
GO_DIST: "/opt/golang/go1.18"
2362+
GO_DIST: "/opt/golang/go1.19"
23602363
tasks:
23612364
- name: ".compile-check"
23622365

@@ -2365,7 +2368,7 @@ buildvariants:
23652368
run_on:
23662369
- ubuntu1804-build
23672370
expansions:
2368-
GO_DIST: "/opt/golang/go1.18"
2371+
GO_DIST: "/opt/golang/go1.19"
23692372
tasks:
23702373
- name: "atlas-test"
23712374

@@ -2374,7 +2377,7 @@ buildvariants:
23742377
run_on:
23752378
- ubuntu1804-build
23762379
expansions:
2377-
GO_DIST: "/opt/golang/go1.18"
2380+
GO_DIST: "/opt/golang/go1.19"
23782381
tasks:
23792382
- name: "test-atlas-data-lake"
23802383

@@ -2409,7 +2412,7 @@ buildvariants:
24092412
- name: "aws-auth-test"
24102413

24112414
- matrix_name: "ocsp-test"
2412-
matrix_spec: { version: ["4.4", "5.0", "6.0", "latest"], ocsp-rhel-70: ["rhel70-go-1-18"] }
2415+
matrix_spec: { version: ["4.4", "5.0", "6.0", "latest"], ocsp-rhel-70: ["rhel70-go-1-19"] }
24132416
display_name: "OCSP ${version} ${ocsp-rhel-70}"
24142417
batchtime: 20160 # Use a batchtime of 14 days as suggested by the OCSP test README
24152418
tasks:
@@ -2424,15 +2427,15 @@ buildvariants:
24242427
- name: ".ocsp-rsa !.ocsp-staple"
24252428

24262429
- matrix_name: "ocsp-test-macos"
2427-
matrix_spec: { version: ["4.4", "5.0", "6.0", "latest"], os-ssl-40: ["osx-go-1-18"] }
2430+
matrix_spec: { version: ["4.4", "5.0", "6.0", "latest"], os-ssl-40: ["macos11-go-1-19"] }
24282431
display_name: "OCSP ${version} ${os-ssl-40}"
24292432
batchtime: 20160 # Use a batchtime of 14 days as suggested by the OCSP test README
24302433
tasks:
24312434
# macos MongoDB servers do not staple OCSP responses and only support RSA.
24322435
- name: ".ocsp-rsa !.ocsp-staple"
24332436

24342437
- matrix_name: "race-test"
2435-
matrix_spec: { version: ["latest"], os-ssl-40: ["ubuntu1804-64-go-1-18"] }
2438+
matrix_spec: { version: ["latest"], os-ssl-40: ["ubuntu1804-64-go-1-19"] }
24362439
display_name: "Race Detector Test"
24372440
tasks:
24382441
- name: ".race"
@@ -2444,32 +2447,32 @@ buildvariants:
24442447
- name: ".versioned-api"
24452448

24462449
- matrix_name: "kms-tls-test"
2447-
matrix_spec: { version: ["latest"], os-ssl-40: ["ubuntu1804-64-go-1-18"] }
2450+
matrix_spec: { version: ["latest"], os-ssl-40: ["ubuntu1804-64-go-1-19"] }
24482451
display_name: "KMS TLS ${os-ssl-40}"
24492452
tasks:
24502453
- name: ".kms-tls"
24512454

24522455
- matrix_name: "load-balancer-test"
24532456
# The LB software is only available on Ubuntu 18.04, so we don't test on all OSes.
2454-
matrix_spec: { version: ["5.0", "6.0", "latest", "rapid"], os-ssl-40: ["ubuntu1804-64-go-1-18"] }
2457+
matrix_spec: { version: ["5.0", "6.0", "latest", "rapid"], os-ssl-40: ["ubuntu1804-64-go-1-19"] }
24552458
display_name: "Load Balancer Support ${version} ${os-ssl-40}"
24562459
tasks:
24572460
- name: ".load-balancer"
24582461

24592462
- matrix_name: "serverless"
2460-
matrix_spec: { os-ssl-40: ["ubuntu1804-64-go-1-18"] }
2463+
matrix_spec: { os-ssl-40: ["ubuntu1804-64-go-1-19"] }
24612464
display_name: "Serverless ${os-ssl-40}"
24622465
tasks:
24632466
- "serverless_task_group"
24642467

24652468
- matrix_name: "kms-kmip-test"
2466-
matrix_spec: { version: ["latest"], os-ssl-40: ["ubuntu1804-64-go-1-18"] }
2469+
matrix_spec: { version: ["latest"], os-ssl-40: ["ubuntu1804-64-go-1-19"] }
24672470
display_name: "KMS KMIP ${os-ssl-40}"
24682471
tasks:
24692472
- name: ".kms-kmip"
24702473

24712474
- matrix_name: "fuzz-test"
2472-
matrix_spec: { version: ["5.0"], os-ssl-40: ["ubuntu1804-64-go-1-18"] }
2475+
matrix_spec: { version: ["5.0"], os-ssl-40: ["ubuntu1804-64-go-1-19"] }
24732476
display_name: "Fuzz ${version} ${os-ssl-40}"
24742477
tasks:
24752478
- name: "test-fuzz"
@@ -2480,7 +2483,7 @@ buildvariants:
24802483
run_on:
24812484
- debian11-small
24822485
expansions:
2483-
GO_DIST: "/opt/golang/go1.18"
2486+
GO_DIST: "/opt/golang/go1.19"
24842487
tasks:
24852488
- name: testgcpkms_task_group
24862489
batchtime: 20160 # Use a batchtime of 14 days as suggested by the CSFLE test README
@@ -2491,7 +2494,7 @@ buildvariants:
24912494
run_on:
24922495
- debian11-small
24932496
expansions:
2494-
GO_DIST: "/opt/golang/go1.18"
2497+
GO_DIST: "/opt/golang/go1.19"
24952498
tasks:
24962499
- testawskms-task
24972500
- testawskms-fail-task

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ The MongoDB supported driver for Go.
2323
## Requirements
2424

2525
- Go 1.13 or higher. We aim to support the latest versions of Go.
26-
- Go 1.18 or higher is required to run the driver test suite.
26+
- Go 1.19 or higher is required to run the driver test suite.
2727
- MongoDB 3.6 and higher.
2828

2929
-------------------------

benchmark/canary.go

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,18 @@ import (
1010
"context"
1111
)
1212

13+
// CanaryIncCase is a no-op.
14+
//
15+
// Deprecated: CanaryIncCase has no observable effect, so recent versions of the Go compiler may
16+
// bypass calls to it in the compiled binary. It should not be used in benchmarks.
1317
func CanaryIncCase(ctx context.Context, tm TimerManager, iters int) error {
14-
var canaryCount int
15-
for i := 0; i < iters; i++ {
16-
canaryCount++
17-
}
1818
return nil
1919
}
2020

21-
var globalCanaryCount int
22-
21+
// GlobalCanaryIncCase is a no-op.
22+
//
23+
// Deprecated: GlobalCanaryIncCase has no observable effect, so recent versions of the Go compiler
24+
// may bypass calls to it in the compiled binary. It should not be used in benchmarks.
2325
func GlobalCanaryIncCase(ctx context.Context, tm TimerManager, iters int) error {
24-
for i := 0; i < iters; i++ {
25-
globalCanaryCount++
26-
}
27-
2826
return nil
2927
}

benchmark/canary_test.go

Lines changed: 0 additions & 12 deletions
This file was deleted.

benchmark/harness.go

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -45,20 +45,6 @@ func WrapCase(bench BenchCase) BenchFunction {
4545

4646
func getAllCases() []*CaseDefinition {
4747
return []*CaseDefinition{
48-
{
49-
Bench: CanaryIncCase,
50-
Count: million,
51-
Size: -1,
52-
Runtime: MinimumRuntime,
53-
RequiredIterations: ten,
54-
},
55-
{
56-
Bench: GlobalCanaryIncCase,
57-
Count: million,
58-
Size: -1,
59-
Runtime: MinimumRuntime,
60-
RequiredIterations: ten,
61-
},
6248
{
6349
Bench: BSONFlatDocumentEncoding,
6450
Count: tenThousand,

docs/CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Before starting to write code, look for existing [tickets](https://jira.mongodb.
1313
The Go Driver team uses GitHub to manage and review all code changes. Patches should generally be made against the master (default) branch and include relevant tests, if
1414
applicable.
1515

16-
Code should compile and tests should pass under all Go versions which the driver currently supports. Currently the Go Driver supports a minimum version of Go 1.13 and requires Go 1.18 for development. Please run the following Make targets to validate your changes:
16+
Code should compile and tests should pass under all Go versions which the driver currently supports. Currently the Go Driver supports a minimum version of Go 1.13 and requires Go 1.19 for development. Please run the following Make targets to validate your changes:
1717
- `make fmt`
1818
- `make lint` (requires [golangci-lint](https://github.com/golangci/golangci-lint) and [lll](https://github.com/walle/lll) to be installed and available in the `PATH`)
1919
- `make test`

0 commit comments

Comments
 (0)