Skip to content

Commit bd0d7d5

Browse files
authored
Merge pull request #57 from nao1215/without-cgo
Change SQLite3 driver from mattn/go-sqlite3 to modernc.org/sqlite
2 parents d935c9a + 712a01a commit bd0d7d5

18 files changed

Lines changed: 123 additions & 55 deletions

File tree

.golangci.yml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,19 @@
11
run:
2-
go: "1.20"
2+
go: "1.21"
33

44
issues:
55
exclude-use-default: false
66

77
linters:
88
disable-all: true
99
enable:
10-
- deadcode
1110
- errcheck
1211
- gosimple
1312
- govet
1413
- ineffassign
1514
- staticcheck
16-
- structcheck
1715
- typecheck
1816
- unused
19-
- varcheck
2017
- asciicheck
2118
- bodyclose
2219
- dogsled
@@ -30,7 +27,6 @@ linters:
3027
- gocritic
3128
- goimports
3229
- gosec
33-
- ifshort
3430
- misspell
3531
- nakedret
3632
- noctx

.goreleaser.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ builds:
1010
ldflags:
1111
- -s -w -X 'github.com/nao1215/sqly/config.Version=v{{ .Version }}'
1212
env:
13-
- CGO_ENABLED=1
13+
- CGO_ENABLED=0
1414
goos:
1515
- linux
16-
#- windows
17-
#- darwin
16+
- windows
17+
- darwin
1818
goarch:
1919
- amd64
2020
archives:

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ GO_PACKAGES = $(shell $(GO_LIST) $(GO_PKGROOT))
1818
GO_LDFLAGS = -ldflags '-X github.com/nao1215/sqly/config.Version=${VERSION}'
1919

2020
build: ## Build binary
21-
env GO111MODULE=on CGO_ENABLED=1 GOOS=$(GOOS) GOARCH=$(GOARCH) $(GO_BUILD) $(GO_LDFLAGS) -o $(APP) main.go
21+
env GO111MODULE=on CGO_ENABLED=0 GOOS=$(GOOS) GOARCH=$(GOARCH) $(GO_BUILD) $(GO_LDFLAGS) -o $(APP) main.go
2222

2323
clean: ## Clean project
2424
-rm -rf $(APP) cover.out cover.html

config/argument_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ func getStdout(t *testing.T, f func()) string {
174174
Stdout = w
175175

176176
f()
177-
w.Close()
177+
w.Close() //nolint
178178

179179
var buffer bytes.Buffer
180180
if _, err := buffer.ReadFrom(r); err != nil {

config/db.go

Lines changed: 46 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
package config
22

3-
import "database/sql"
3+
import (
4+
"database/sql"
5+
"database/sql/driver"
6+
"fmt"
7+
"sync"
8+
9+
"modernc.org/sqlite"
10+
)
411

512
// MemoryDB is *sql.DB for excuting sql.
613
type MemoryDB *sql.DB
@@ -15,7 +22,7 @@ func NewInMemDB() (MemoryDB, func(), error) {
1522
if err != nil {
1623
return nil, nil, err
1724
}
18-
return MemoryDB(db), func() { db.Close() }, nil
25+
return MemoryDB(db), func() { db.Close() }, nil //nolint
1926
}
2027

2128
// NewHistoryDB create *sql.DB for history.
@@ -25,5 +32,41 @@ func NewHistoryDB(c *Config) (HistoryDB, func(), error) {
2532
if err != nil {
2633
return nil, nil, err
2734
}
28-
return HistoryDB(db), func() { db.Close() }, nil
35+
return HistoryDB(db), func() { db.Close() }, nil //nolint
36+
}
37+
38+
// InitSQLite3 registers the sqlite3 driver.
39+
func InitSQLite3() {
40+
var once sync.Once
41+
once.Do(func() {
42+
sql.Register("sqlite3", sqliteDriver{Driver: &sqlite.Driver{}})
43+
})
44+
}
45+
46+
// sqliteDriver is a driver that enables foreign keys.
47+
type sqliteDriver struct {
48+
*sqlite.Driver
49+
}
50+
51+
// Open opens a database specified by its database driver name and a driver-specific data source name.
52+
func (d sqliteDriver) Open(name string) (driver.Conn, error) {
53+
conn, err := d.Driver.Open(name)
54+
if err != nil {
55+
return conn, err
56+
}
57+
c, ok := conn.(interface {
58+
Exec(stmt string, args []driver.Value) (driver.Result, error)
59+
})
60+
if !ok {
61+
return nil, fmt.Errorf("connection does not support Exec method")
62+
}
63+
64+
if _, err := c.Exec("PRAGMA foreign_keys = on;", nil); err != nil {
65+
if err := conn.Close(); err != nil {
66+
return nil, fmt.Errorf("failed to close connection: %w", err)
67+
}
68+
return nil, fmt.Errorf("failed to enable enable foreign keys: %w", err)
69+
}
70+
71+
return conn, nil
2972
}

go.mod

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module github.com/nao1215/sqly
22

3-
go 1.20
3+
go 1.21
44

55
require (
66
github.com/c-bata/go-prompt v0.2.6
@@ -14,25 +14,37 @@ require (
1414
github.com/olekukonko/tablewriter v0.0.5
1515
github.com/spf13/pflag v1.0.5
1616
github.com/xuri/excelize/v2 v2.8.1
17+
modernc.org/sqlite v1.29.8
1718
)
1819

1920
require (
21+
github.com/dustin/go-humanize v1.0.1 // indirect
2022
github.com/google/subcommands v1.2.0 // indirect
23+
github.com/google/uuid v1.6.0 // indirect
24+
github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect
2125
github.com/mattn/go-isatty v0.0.20 // indirect
2226
github.com/mattn/go-runewidth v0.0.9 // indirect
2327
github.com/mattn/go-tty v0.0.4 // indirect
2428
github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 // indirect
29+
github.com/ncruces/go-strftime v0.1.9 // indirect
2530
github.com/pkg/term v1.2.0-beta.2 // indirect
2631
github.com/pmezard/go-difflib v1.0.0 // indirect
32+
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect
2733
github.com/richardlehane/mscfb v1.0.4 // indirect
2834
github.com/richardlehane/msoleps v1.0.3 // indirect
2935
github.com/sergi/go-diff v1.2.0 // indirect
3036
github.com/xuri/efp v0.0.0-20231025114914-d1ff6096ae53 // indirect
3137
github.com/xuri/nfp v0.0.0-20230919160717-d98342af3f05 // indirect
3238
golang.org/x/crypto v0.21.0 // indirect
33-
golang.org/x/mod v0.14.0 // indirect
39+
golang.org/x/mod v0.16.0 // indirect
3440
golang.org/x/net v0.23.0 // indirect
35-
golang.org/x/sys v0.18.0 // indirect
41+
golang.org/x/sys v0.19.0 // indirect
3642
golang.org/x/text v0.14.0 // indirect
37-
golang.org/x/tools v0.17.0 // indirect
43+
golang.org/x/tools v0.19.0 // indirect
44+
modernc.org/gc/v3 v3.0.0-20240107210532-573471604cb6 // indirect
45+
modernc.org/libc v1.49.3 // indirect
46+
modernc.org/mathutil v1.6.0 // indirect
47+
modernc.org/memory v1.8.0 // indirect
48+
modernc.org/strutil v1.2.0 // indirect
49+
modernc.org/token v1.1.0 // indirect
3850
)

go.sum

Lines changed: 37 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,22 @@ github.com/caarlos0/env/v6 v6.10.1/go.mod h1:hvp/ryKXKipEkcuYjs9mI4bBCg+UI0Yhgm5
55
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
66
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
77
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
8+
github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY=
9+
github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto=
810
github.com/fatih/color v1.16.0 h1:zmkK9Ngbjj+K0yRhTVONQh1p/HknKYSlNT+vZCzyokM=
911
github.com/fatih/color v1.16.0/go.mod h1:fL2Sau1YI5c0pdGEVCbKQbLXB6edEj1ZgiY4NijnWvE=
1012
github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M=
1113
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
1214
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
15+
github.com/google/pprof v0.0.0-20240409012703-83162a5b38cd h1:gbpYu9NMq8jhDVbvlGkMFWCjLFlqqEZjEmObmhUy6Vo=
1316
github.com/google/subcommands v1.2.0 h1:vWQspBTo2nEqTUFita5/KeEWlUL8kQObDFbub/EN9oE=
1417
github.com/google/subcommands v1.2.0/go.mod h1:ZjhPrFU+Olkh9WazFPsl27BQ4UPiG37m3yTrtFlrHVk=
18+
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
19+
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
1520
github.com/google/wire v0.6.0 h1:HBkoIh4BdSxoyo9PveV8giw7ZsaBOvzWKfcg/6MrVwI=
1621
github.com/google/wire v0.6.0/go.mod h1:F4QhpQ9EDIdJ1Mbop/NZBRB+5yrR6qg3BnctaoUk6NA=
22+
github.com/hashicorp/golang-lru/v2 v2.0.7 h1:a+bsQ5rvGLjzHuww6tVxozPZFVghXaHOwFs4luLUK2k=
23+
github.com/hashicorp/golang-lru/v2 v2.0.7/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyfM2/ZepoAG6RGpeM=
1724
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
1825
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
1926
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
@@ -40,12 +47,16 @@ github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 h1:RWengNIwukTxcDr9
4047
github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826/go.mod h1:TaXosZuwdSHYgviHp1DAtfrULt5eUgsSMsZf+YrPgl8=
4148
github.com/nao1215/gorky v0.2.1 h1:kxXYhCNBbtGru9CCSYx+QC0JZfZJ1csY3uLbb5n2WKA=
4249
github.com/nao1215/gorky v0.2.1/go.mod h1:fJNLiXzn3YkteARC8xghfHjkt+C5xtHOaRgmVnJEMOs=
50+
github.com/ncruces/go-strftime v0.1.9 h1:bY0MQC28UADQmHmaF5dgpLmImcShSi2kHU9XLdhx/f4=
51+
github.com/ncruces/go-strftime v0.1.9/go.mod h1:Fwc5htZGVVkseilnfgOVb9mKy6w1naJmn9CehxcKcls=
4352
github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec=
4453
github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY=
4554
github.com/pkg/term v1.2.0-beta.2 h1:L3y/h2jkuBVFdWiJvNfYfKmzcCnILw7mJWm2JQuMppw=
4655
github.com/pkg/term v1.2.0-beta.2/go.mod h1:E25nymQcrSllhX42Ok8MRm1+hyBdHY0dCeiKZ9jpNGw=
4756
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
4857
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
58+
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec h1:W09IVJc94icq4NjY3clb7Lk8O1qJ8BdBEF8z0ibU0rE=
59+
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo=
4960
github.com/richardlehane/mscfb v1.0.4 h1:WULscsljNPConisD5hR0+OyZjwK46Pfyr6mPu5ZawpM=
5061
github.com/richardlehane/mscfb v1.0.4/go.mod h1:YzVpcZg9czvAuhk9T+a3avCpcFPMUWm7gK3DypaEsUk=
5162
github.com/richardlehane/msoleps v1.0.1/go.mod h1:BWev5JBpU9Ko2WAgmZEuiz4/u3ZYTKbjLycmwiWUfWg=
@@ -75,8 +86,9 @@ golang.org/x/image v0.14.0 h1:tNgSxAFe3jC4uYqvZdTr84SZoM1KfwdC9SKIFrLjFn4=
7586
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
7687
golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
7788
golang.org/x/mod v0.12.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
78-
golang.org/x/mod v0.14.0 h1:dGoOF9QVLYng8IHTm7BAyWqCqSheQ5pYWGhzW00YJr0=
7989
golang.org/x/mod v0.14.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
90+
golang.org/x/mod v0.16.0 h1:QX4fJ0Rr5cPQCF7O9lh9Se4pmwfwskqZfq5moyldzic=
91+
golang.org/x/mod v0.16.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
8092
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
8193
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
8294
golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
@@ -111,8 +123,8 @@ golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
111123
golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
112124
golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
113125
golang.org/x/sys v0.16.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
114-
golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4=
115-
golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
126+
golang.org/x/sys v0.19.0 h1:q5f1RH2jigJ1MoAWp2KTp3gm5zAGFUTarQZ5U386+4o=
127+
golang.org/x/sys v0.19.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
116128
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
117129
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
118130
golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k=
@@ -132,11 +144,32 @@ golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtn
132144
golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc=
133145
golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU=
134146
golang.org/x/tools v0.13.0/go.mod h1:HvlwmtVNQAhOuCjW7xxvovg8wbNq7LwfXh/k7wXUl58=
135-
golang.org/x/tools v0.17.0 h1:FvmRgNOcs3kOa+T20R1uhfP9F6HgG2mfxDv1vrx1Htc=
136147
golang.org/x/tools v0.17.0/go.mod h1:xsh6VxdV005rRVaS6SSAf9oiAqljS7UZUacMZ8Bnsps=
148+
golang.org/x/tools v0.19.0 h1:tfGCXNR1OsFG+sVdLAitlpjAvD/I6dHDKnYrpEZUHkw=
149+
golang.org/x/tools v0.19.0/go.mod h1:qoJWxmGSIBmAeriMx19ogtrEPrGtDbPK634QFIcLAhc=
137150
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
138151
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
139152
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
140153
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
141154
gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
142155
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
156+
modernc.org/cc/v4 v4.20.0 h1:45Or8mQfbUqJOG9WaxvlFYOAQO0lQ5RvqBcFCXngjxk=
157+
modernc.org/ccgo/v4 v4.16.0 h1:ofwORa6vx2FMm0916/CkZjpFPSR70VwTjUCe2Eg5BnA=
158+
modernc.org/fileutil v1.3.0 h1:gQ5SIzK3H9kdfai/5x41oQiKValumqNTDXMvKo62HvE=
159+
modernc.org/gc/v2 v2.4.1 h1:9cNzOqPyMJBvrUipmynX0ZohMhcxPtMccYgGOJdOiBw=
160+
modernc.org/gc/v3 v3.0.0-20240107210532-573471604cb6 h1:5D53IMaUuA5InSeMu9eJtlQXS2NxAhyWQvkKEgXZhHI=
161+
modernc.org/gc/v3 v3.0.0-20240107210532-573471604cb6/go.mod h1:Qz0X07sNOR1jWYCrJMEnbW/X55x206Q7Vt4mz6/wHp4=
162+
modernc.org/libc v1.49.3 h1:j2MRCRdwJI2ls/sGbeSk0t2bypOG/uvPZUsGQFDulqg=
163+
modernc.org/libc v1.49.3/go.mod h1:yMZuGkn7pXbKfoT/M35gFJOAEdSKdxL0q64sF7KqCDo=
164+
modernc.org/mathutil v1.6.0 h1:fRe9+AmYlaej+64JsEEhoWuAYBkOtQiMEU7n/XgfYi4=
165+
modernc.org/mathutil v1.6.0/go.mod h1:Ui5Q9q1TR2gFm0AQRqQUaBWFLAhQpCwNcuhBOSedWPo=
166+
modernc.org/memory v1.8.0 h1:IqGTL6eFMaDZZhEWwcREgeMXYwmW83LYW8cROZYkg+E=
167+
modernc.org/memory v1.8.0/go.mod h1:XPZ936zp5OMKGWPqbD3JShgd/ZoQ7899TUuQqxY+peU=
168+
modernc.org/opt v0.1.3 h1:3XOZf2yznlhC+ibLltsDGzABUGVx8J6pnFMS3E4dcq4=
169+
modernc.org/sortutil v1.2.0 h1:jQiD3PfS2REGJNzNCMMaLSp/wdMNieTbKX920Cqdgqc=
170+
modernc.org/sqlite v1.29.8 h1:nGKglNx9K5v0As+zF0/Gcl1kMkmaU1XynYyq92PbsC8=
171+
modernc.org/sqlite v1.29.8/go.mod h1:lQPm27iqa4UNZpmr4Aor0MH0HkCLbt1huYDfWylLZFk=
172+
modernc.org/strutil v1.2.0 h1:agBi9dp1I+eOnxXeiZawM8F4LawKv4NzGWSaLfyeNZA=
173+
modernc.org/strutil v1.2.0/go.mod h1:/mdcBmfOibveCTBxUl5B5l6W+TTH1FXPLHZE6bTosX0=
174+
modernc.org/token v1.1.0 h1:Xl7Ap9dKaEs5kLoOQeQmPWevfnk/DM5qcLcYlA8ys6Y=
175+
modernc.org/token v1.1.0/go.mod h1:UGzOrNV1mAFSEB63lOFHIpNRUVMvYTc6yu1SMY/XTDM=

infrastructure/memory/sqlite3.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ func (r *sqlite3Repository) Query(ctx context.Context, query string) (*model.Tab
121121
if err != nil {
122122
return nil, err
123123
}
124-
defer rows.Close()
124+
defer rows.Close() //nolint
125125

126126
header, err := rows.Columns()
127127
if err != nil {

infrastructure/persistence/csv_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ func Test_csvRepository_List(t *testing.T) {
1616
if err != nil {
1717
t.Fatal(err)
1818
}
19-
defer f.Close()
19+
defer f.Close() //nolint
2020

2121
csv, err := cr.List(f)
2222
if err != nil {

infrastructure/persistence/ltsv_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ func Test_ltsvRepository_List(t *testing.T) {
7777
if err != nil {
7878
t.Fatal(err)
7979
}
80-
defer f.Close()
80+
defer f.Close() //nolint
8181

8282
ltsv, err := r.List(f)
8383
if err != nil {

0 commit comments

Comments
 (0)