Skip to content

Commit

Permalink
resolve merge conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
benjirewis authored and prestonvasquez committed Dec 8, 2022
1 parent ed484be commit cd79115
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 9 deletions.
1 change: 1 addition & 0 deletions .evergreen/config.yml
Expand Up @@ -1045,6 +1045,7 @@ tasks:
- name: sa-fmt
tags: ["static-analysis"]
commands:
- func: install-linters
- func: run-make
vars:
targets: check-fmt
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Expand Up @@ -47,7 +47,7 @@ build-tests:

.PHONY: check-fmt
check-fmt:
etc/check_fmt.sh $(PKGS)
etc/check_fmt.sh

# check-modules runs "go mod tidy" then "go mod vendor" and exits with a non-zero exit code if there
# are any module or vendored modules changes. The intent is to confirm two properties:
Expand All @@ -69,7 +69,7 @@ doc:

.PHONY: fmt
fmt:
gofmt -l -s -w $(PKGS)
go fmt ./...

.PHONY: lint
lint:
Expand Down
10 changes: 5 additions & 5 deletions etc/check_fmt.sh
@@ -1,11 +1,11 @@
#!/usr/bin/env bash
# check_fmt gopackages...
# Runs gofmt on given packages and checks that *_example_test.go files have wrapped lines.
# check_fmt
# Runs go fmt on all packages in the repo and checks that *_example_test.go files have wrapped lines.

gofmt_out="$(gofmt -l -s "$@")"
gofmt_out="$(go fmt ./...)"

if [[ $gofmt_out ]]; then
echo "gofmt check failed for:";
echo "go fmt check failed for:";
sed -e 's/^/ - /' <<< "$gofmt_out";
exit 1;
fi
Expand All @@ -16,7 +16,7 @@ fi
# E.g ignored lines:
# // "mongodb://ldap-user:ldap-pwd@localhost:27017/?authMechanism=PLAIN"
# // (https://www.mongodb.com/docs/manual/core/authentication-mechanisms-enterprise/#security-auth-ldap).
lll_out="$(find "$@" -type f -name "*_examples_test.go" | lll -w 4 -l 80 -e '^\s*\/\/.+:\/\/' --files)"
lll_out="$(find . -type f -name "*_examples_test.go" | lll -w 4 -l 80 -e '^\s*\/\/.+:\/\/' --files)"

if [[ $lll_out ]]; then
echo "lll check failed for:";
Expand Down
5 changes: 3 additions & 2 deletions mongo/crud_examples_test.go
Expand Up @@ -749,8 +749,9 @@ func ExampleClient_StartSession_withTransaction() {
result, err := sess.WithTransaction(
context.TODO(),
func(sessCtx mongo.SessionContext) (interface{}, error) {
// Use sessCtx as the Context parameter for InsertOne and FindOne so
// both operations are run in a transaction.
// Use the mongo.SessionContext as the Context parameter for
// InsertOne and FindOne so both operations are run in the same
// transaction.

coll := client.Database("db").Collection("coll")
res, err := coll.InsertOne(sessCtx, bson.D{{"x", 1}})
Expand Down

0 comments on commit cd79115

Please sign in to comment.