Skip to content

Commit eaa1dba

Browse files
authored
Merge pull request #13 from peczenyj/main
Fixing github workflow build and linter
2 parents 8057e0d + 9cf974a commit eaa1dba

File tree

7 files changed

+88
-47
lines changed

7 files changed

+88
-47
lines changed

.github/workflows/build.yml

-41
This file was deleted.

.github/workflows/go.yml

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
---
2+
name: Go
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- main
10+
jobs:
11+
build:
12+
runs-on: ubuntu-latest
13+
strategy:
14+
matrix:
15+
go: ['1.17.x', '1.18.x', '1.19.x', '1.20.x', '1.21.x', '1.22.x', '1.23.x']
16+
name: Go ${{ matrix.go }} job
17+
steps:
18+
- uses: actions/checkout@v4
19+
20+
- name: Set up Go
21+
uses: actions/setup-go@v5
22+
with:
23+
go-version: ${{ matrix.go }}
24+
25+
# Run testing on the code
26+
- name: Run testing
27+
run: go test -v ./...

.github/workflows/lint.yml

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
---
2+
name: Lint
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
9+
permissions:
10+
contents: read
11+
12+
jobs:
13+
lint:
14+
name: lint
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v4
18+
- uses: actions/setup-go@v5
19+
with:
20+
go-version: stable
21+
# Run vet & lint on the code
22+
- name: Run vet & lint
23+
run: |
24+
go mod tidy
25+
go mod verify
26+
go fix ./...
27+
go vet -all ./...
28+
29+
- name: govulncheck
30+
uses: golang/govulncheck-action@v1

.gitignore

+24
Original file line numberDiff line numberDiff line change
@@ -1 +1,25 @@
1+
# If you prefer the allow list template instead of the deny list, see community template:
2+
# https://github.com/github/gitignore/blob/main/community/Golang/Go.AllowList.gitignore
3+
#
4+
# Binaries for programs and plugins
5+
*.exe
6+
*.exe~
7+
*.dll
8+
*.so
9+
*.dylib
10+
11+
# Test binary, built with `go test -c`
12+
*.test
13+
14+
# Output of the go coverage tool, specifically when used with LiteIDE
15+
*.out
16+
17+
# Dependency directories (remove the comment below to include it)
18+
vendor/
19+
20+
# Go workspace file
21+
go.work
22+
go.work.sum
23+
24+
# Original
125
.vscode

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
[![GoDoc Reference](https://godoc.org/github.com/leporo/sqlf?status.svg)](http://godoc.org/github.com/leporo/sqlf)
44
![Build Status](https://github.com/leporo/sqlf/actions/workflows/build.yml/badge.svg)
55
[![Go Report Card](https://goreportcard.com/badge/github.com/leporo/sqlf)](https://goreportcard.com/report/github.com/leporo/sqlf)
6+
[![Mentioned in Awesome Go](https://awesome.re/mentioned-badge-flat.svg)](https://github.com/avelino/awesome-go#sql-query-builders)
67

78

89
A fast SQL query builder for Go.

example_test.go

+5-3
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,10 @@ func (db *dummyDB) QueryRowContext(ctx context.Context, query string, args ...in
2222
return nil
2323
}
2424

25-
var db = new(dummyDB)
26-
var ctx = context.Background()
25+
var (
26+
db = new(dummyDB)
27+
ctx = context.Background()
28+
)
2729

2830
func Example() {
2931
var (
@@ -223,7 +225,7 @@ func ExampleStmt_From() {
223225
fmt.Println(q.String())
224226
q.Close()
225227
// Output:
226-
//SELECT * FROM (SELECT id, section, header, score, row_number() OVER (PARTITION BY section ORDER BY score DESC) AS rating_in_section FROM news ORDER BY section, rating_in_section) counted_news WHERE rating_in_section <= 5
228+
// SELECT * FROM (SELECT id, section, header, score, row_number() OVER (PARTITION BY section ORDER BY score DESC) AS rating_in_section FROM news ORDER BY section, rating_in_section) counted_news WHERE rating_in_section <= 5
227229
}
228230

229231
func ExampleStmt_SubQuery() {

pool.go

+1-3
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,7 @@ import (
66
"github.com/valyala/bytebufferpool"
77
)
88

9-
var (
10-
stmtPool = sync.Pool{New: newStmt}
11-
)
9+
var stmtPool = sync.Pool{New: newStmt}
1210

1311
func newStmt() interface{} {
1412
return &Stmt{

0 commit comments

Comments
 (0)