Skip to content

Commit 17dab82

Browse files
author
Sam Kleinman
committed
GODRIVER-416: run errcheck in evergreen and fix outstanding errors
Change-Id: I1420c05e17a20018c71cab2f4ae7c2e3a6c66e79
1 parent 75e2ec3 commit 17dab82

File tree

2 files changed

+10
-12
lines changed

2 files changed

+10
-12
lines changed

.evergreen/config.yml

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ functions:
120120
${PREPARE_SHELL}
121121
# any go tools that we need
122122
go get -u github.com/golang/lint/golint
123+
go get -u github.com/kisielk/errcheck
123124
124125
# initialize submodules
125126
git submodule init
@@ -211,17 +212,9 @@ functions:
211212
done
212213
213214
214-
install-dependencies:
215-
type: test
216-
params:
217-
working_dir: src/github.com/mongodb/mongo-go-driver
218-
script: |
219-
${PREPARE_SHELL}
220-
file="${PROJECT_DIRECTORY}/.evergreen/install-dependencies.sh"
221-
[ -f ${file} ] && sh ${file} || echo "${file} not available, skipping"
222-
223215
run-make:
224216
- command: shell.exec
217+
type: test
225218
params:
226219
working_dir: src/github.com/mongodb/mongo-go-driver
227220
script: |
@@ -292,7 +285,6 @@ pre:
292285
- func: windows-fix
293286
- func: fix-absolute-paths
294287
- func: make-files-executable
295-
- func: install-dependencies
296288

297289
post:
298290
- command: gotest.parse_files
@@ -309,6 +301,13 @@ tasks:
309301
vars:
310302
targets: check-fmt
311303

304+
- name: sa-errcheck
305+
tags: ["static-analysis"]
306+
commands:
307+
- func: run-make
308+
vars:
309+
targets: errcheck
310+
312311
- name: sa-lint
313312
tags: ["static-analysis"]
314313
commands:

bson/extjson_builder.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,7 @@ func ParseExtJSONArray(s string) (*Array, error) {
4343
}
4444

4545
buf := make([]byte, b.RequiredBytes())
46-
_, err = b.WriteDocument(buf)
47-
if err != nil {
46+
if _, err = b.WriteDocument(buf); err != nil {
4847
return nil, err
4948
}
5049

0 commit comments

Comments
 (0)