Skip to content

Commit

Permalink
github/workflows: add linting workflow (#5)
Browse files Browse the repository at this point in the history
* github/workflows: add linting workflow

* Hint the linter not to complain about unchecked rollback error
  • Loading branch information
julieta-311 authored Oct 28, 2023
1 parent 9d0fee6 commit fe0dafe
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 1 deletion.
27 changes: 27 additions & 0 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Golangci lint
on:
push:
branches:
- master
pull_request:
permissions:
contents: read
jobs:
golangci:
name: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: 1.21
env:
GOFLAGS: -mod=mod

- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: latest
skip-pkg-cache: true
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ func (d *db) ExecContext(ctx context.Context, query string, args ...any) (_ sql.
if err != nil {
return nil, fmt.Errorf("failed to begin transaction: %w", err)
}
defer tx.Rollback(ctx)
defer tx.Rollback(ctx) // nolint:errcheck

_, err = tx.Exec(ctx, query, args...)
if err != nil {
Expand Down

0 comments on commit fe0dafe

Please sign in to comment.