Skip to content

Commit

Permalink
Fix suggestions, add CI step
Browse files Browse the repository at this point in the history
  • Loading branch information
erikdubbelboer committed May 26, 2024
1 parent f642808 commit de8e41c
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 3 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,27 @@ on:

jobs:

lint:
runs-on: ubuntu-latest
strategy:
matrix:
# We make use of the `slices` feature, only available in 1.21 and newer
go-version: [ '1.21', '1.22' ]

steps:
- uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}

- name: Lint
uses: golangci/golangci-lint-action@v6
with:
version: v1.56.2
args: --verbose

build:
runs-on: ubuntu-latest
strategy:
Expand Down
2 changes: 1 addition & 1 deletion collection_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -606,7 +606,7 @@ func benchmarkCollection_Query(b *testing.B, n int, withContent bool) {
}

if err := c.AddDocument(ctx, doc); err != nil {
b.Fatal(err)
b.Fatal("expected nil, got", err)
}
}

Expand Down
8 changes: 6 additions & 2 deletions db_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,9 @@ func TestDB_DeleteCollection(t *testing.T) {
}

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

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

// Reset DB
db.Reset() // nolint: errcheck
if err := db.Reset(); err != nil {
t.Fatal("expected no error, got", err)
}

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

0 comments on commit de8e41c

Please sign in to comment.