Skip to content

Commit de8e41c

Browse files
Fix suggestions, add CI step
1 parent f642808 commit de8e41c

File tree

3 files changed

+28
-3
lines changed

3 files changed

+28
-3
lines changed

‎.github/workflows/go.yml‎

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,27 @@ on:
1010

1111
jobs:
1212

13+
lint:
14+
runs-on: ubuntu-latest
15+
strategy:
16+
matrix:
17+
# We make use of the `slices` feature, only available in 1.21 and newer
18+
go-version: [ '1.21', '1.22' ]
19+
20+
steps:
21+
- uses: actions/checkout@v4
22+
23+
- name: Set up Go
24+
uses: actions/setup-go@v5
25+
with:
26+
go-version: ${{ matrix.go-version }}
27+
28+
- name: Lint
29+
uses: golangci/golangci-lint-action@v6
30+
with:
31+
version: v1.56.2
32+
args: --verbose
33+
1334
build:
1435
runs-on: ubuntu-latest
1536
strategy:

‎collection_test.go‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -606,7 +606,7 @@ func benchmarkCollection_Query(b *testing.B, n int, withContent bool) {
606606
}
607607

608608
if err := c.AddDocument(ctx, doc); err != nil {
609-
b.Fatal(err)
609+
b.Fatal("expected nil, got", err)
610610
}
611611
}
612612

‎db_test.go‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,9 @@ func TestDB_DeleteCollection(t *testing.T) {
394394
}
395395

396396
// Delete collection
397-
db.DeleteCollection(name) // nolint: errcheck
397+
if err := db.DeleteCollection(name); err != nil {
398+
t.Fatal("expected no error, got", err)
399+
}
398400

399401
// Check expectations
400402
// We don't have access to the documents field, but we can rely on DB.ListCollections()
@@ -426,7 +428,9 @@ func TestDB_Reset(t *testing.T) {
426428
}
427429

428430
// Reset DB
429-
db.Reset() // nolint: errcheck
431+
if err := db.Reset(); err != nil {
432+
t.Fatal("expected no error, got", err)
433+
}
430434

431435
// Check expectations
432436
// We don't have access to the documents field, but we can rely on DB.ListCollections()

0 commit comments

Comments
 (0)