Skip to content

Commit

Permalink
pglock: enforce version control to linter
Browse files Browse the repository at this point in the history
  • Loading branch information
ucirello committed Sep 26, 2023
1 parent 935fc8b commit 88bdc03
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,7 @@ jobs:

- name: Test
run: |
go test -coverprofile=coverage.out -shuffle on -short -v -dsn="postgres://postgres:everyone@localhost:5432/postgres?sslmode=disable" || (sleep 5; go test -coverprofile=coverage.out -shuffle on -short -v -dsn="postgres://postgres:everyone@localhost:5432/postgres?sslmode=disable")
go tool cover -html=coverage.out -o coverage.html
make test
- name: Upload coverage
uses: actions/upload-artifact@v3
Expand Down
6 changes: 6 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
linters:
go install github.com/golangci/golangci-lint/cmd/[email protected]
golangci-lint -j 1 run --disable-all -E "errcheck" -E "godot" -E "govet" -E "ineffassign" -E "staticcheck" -E "unparam" -E "unused"
test: linters
go test -count 1 -coverprofile=coverage.out -shuffle on -short -v -dsn="postgres://postgres:everyone@localhost:5432/postgres?sslmode=disable" || (sleep 5; go test -coverprofile=coverage.out -shuffle on -short -v -dsn="postgres://postgres:everyone@localhost:5432/postgres?sslmode=disable")
go tool cover -html=coverage.out -o coverage.html
2 changes: 1 addition & 1 deletion helpers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import (
var chars = []byte("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ")

func init() {
rand.Seed(time.Now().UnixNano())
rand.New(rand.NewSource(time.Now().UnixNano()))
}

func randStr() string {
Expand Down

0 comments on commit 88bdc03

Please sign in to comment.