Details
-
Bug
-
Resolution: Done
-
Major - P3
-
None
-
1.0.1
-
None
Description
I've noticed that there is a lot of real bugs in the code.
I've detected them with https://github.com/golangci/golangci-lint
and this config:
run:
|
deadline: "10m" |
linters:
|
disable-all: true |
enable:
|
- "deadcode" |
- "errcheck" |
- "gofmt" |
- "goimports" |
- "golint" |
- "govet" |
- "ineffassign" |
- "megacheck" |
- "misspell" |
- "nakedret" |
- "structcheck" |
- "unconvert" |
- "unparam" |
- "varcheck" |
issues:
|
exclude-use-default: false |
max-per-linter: 0 |
max-same-issues: 0 |
|
Example of bugs:
bson/primitive/primitive.go:58:38: SA4000: identical expressions on the left and right side of the '==' operator (staticcheck)bson/primitive/primitive.go:58:38: SA4000: identical expressions on the left and right side of the '==' operator (staticcheck) return rp.Pattern == rp2.Pattern && rp.Options == rp.Options |
Maybe it should be "rp2" ?
bson/bsonrw/extjson_parser.go:136:6: ineffectual assignment to `err` (ineffassign)bson/bsonrw/extjson_parser.go:136:6: ineffectual assignment to `err` (ineffassign) err = ejp.err |
The error is assigned, but never checked.
Attachments
Issue Links
- is related to
-
GODRIVER-2156 Enable all remaining golangci-lint linters and fix any identified issues
-
- Closed
-
- related to
-
GODRIVER-2157 Detect bit alignment issues when using "sync/atomic" to access struct fields
-
- Closed
-