Skip to content

Commit 688e74b

Browse files
matthewdaleBenjamin Rewis
authored andcommitted
Fix new lint failures and drop deprecated linters. (#1055)
1 parent 0618fdf commit 688e74b

File tree

11 files changed

+30
-7
lines changed

11 files changed

+30
-7
lines changed

.golangci.yml

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ linters:
55
disable-all: true
66
# TODO(GODRIVER-2156): Enable all commented-out linters.
77
enable:
8-
- deadcode
98
- errcheck
109
# - errorlint
1110
- gocritic
@@ -20,12 +19,10 @@ linters:
2019
- prealloc
2120
- revive
2221
- staticcheck
23-
- structcheck
2422
- typecheck
2523
- unused
2624
- unconvert
2725
- unparam
28-
- varcheck
2926

3027
linters-settings:
3128
errcheck:
@@ -97,7 +94,6 @@ issues:
9794
- path: x/mongo/driver/auth/internal/awsv4
9895
linters:
9996
- unused
100-
- structcheck
10197
# Disable "unused" linter for code files that depend on the "mongocrypt.MongoCrypt" type because
10298
# the linter build doesn't work correctly with CGO enabled. As a result, all calls to a
10399
# "mongocrypt.MongoCrypt" API appear to always panic (see mongocrypt_not_enabled.go), leading
@@ -115,9 +111,12 @@ issues:
115111
# "benchmark" directories.
116112
- path: (internal\/|benchmark\/)
117113
text: exported (.+) should have comment( \(or a comment on this block\))? or be unexported
118-
# Disable deadcode and unused linter for "golang.org/x/exp/rand" package in internal/randutil/rand.
114+
# Ignore missing package comments for directories that aren't frequently used by external users.
115+
# TODO(GODRIVER-2517): Remove "mongo/testaws" and "mongo/testatlas" from the ignored paths when
116+
# TODO we move those packages to the "cmd/" directory.
117+
- path: (internal\/|benchmark\/|x\/|cmd\/|mongo\/integration\/|mongo\/(testaws\/|testatlas\/))
118+
text: should have a package comment
119+
# Disable unused linter for "golang.org/x/exp/rand" package in internal/randutil/rand.
119120
- path: internal/randutil/rand
120121
linters:
121-
- deadcode
122122
- unused
123-
- varcheck

bson/bsonoptions/doc.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
// Copyright (C) MongoDB, Inc. 2022-present.
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License"); you may
4+
// not use this file except in compliance with the License. You may obtain
5+
// a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
6+
7+
// Package bsonoptions defines the optional configurations for the BSON codecs.
8+
package bsonoptions

bson/bsonrw/bsonrwtest/bsonrwtest.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
// not use this file except in compliance with the License. You may obtain
55
// a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
66

7+
// Package bsonrwtest provides utilities for testing the "bson/bsonrw" package.
78
package bsonrwtest // import "go.mongodb.org/mongo-driver/bson/bsonrw/bsonrwtest"
89

910
import (

mongo/address/addr.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
// not use this file except in compliance with the License. You may obtain
55
// a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
66

7+
// Package address provides structured representations of network addresses.
78
package address // import "go.mongodb.org/mongo-driver/mongo/address"
89

910
import (

mongo/description/description.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
// not use this file except in compliance with the License. You may obtain
55
// a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
66

7+
// Package description contains types and functions for describing the state of MongoDB clusters.
78
package description // import "go.mongodb.org/mongo-driver/mongo/description"
89

910
// Unknown is an unknown server or topology kind.

mongo/options/doc.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
// Copyright (C) MongoDB, Inc. 2022-present.
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License"); you may
4+
// not use this file except in compliance with the License. You may obtain
5+
// a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
6+
7+
// Package options defines the optional configurations for the MongoDB Go Driver.
8+
package options

mongo/readconcern/readconcern.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
// not use this file except in compliance with the License. You may obtain
55
// a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
66

7+
// Package readconcern defines read concerns for MongoDB operations.
78
package readconcern // import "go.mongodb.org/mongo-driver/mongo/readconcern"
89

910
import (

mongo/readpref/readpref.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
// not use this file except in compliance with the License. You may obtain
55
// a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
66

7+
// Package readpref defines read preferences for MongoDB queries.
78
package readpref // import "go.mongodb.org/mongo-driver/mongo/readpref"
89

910
import (

mongo/writeconcern/writeconcern.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
// not use this file except in compliance with the License. You may obtain
55
// a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
66

7+
// Package writeconcern defines write concerns for MongoDB operations.
78
package writeconcern // import "go.mongodb.org/mongo-driver/mongo/writeconcern"
89

910
import (

tag/tag.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
// not use this file except in compliance with the License. You may obtain
55
// a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
66

7+
// Package tag provides a way to define filters for tagged servers.
78
package tag // import "go.mongodb.org/mongo-driver/tag"
89

910
import (

0 commit comments

Comments
 (0)