Skip to content

Commit a908b82

Browse files
committed
gofmt -r 'interface{} -> any' -w .
1 parent df6866e commit a908b82

25 files changed

+63
-63
lines changed

binding_connection_pool_adapter.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,10 @@ func (this *BindingConnectionPoolAdapter) Close() error {
3232
return this.inner.Close()
3333
}
3434

35-
func (this *BindingConnectionPoolAdapter) Execute(ctx context.Context, statement string, parameters ...interface{}) (uint64, error) {
35+
func (this *BindingConnectionPoolAdapter) Execute(ctx context.Context, statement string, parameters ...any) (uint64, error) {
3636
return this.inner.Execute(ctx, statement, parameters...)
3737
}
3838

39-
func (this *BindingConnectionPoolAdapter) BindSelect(ctx context.Context, binder Binder, statement string, parameters ...interface{}) error {
39+
func (this *BindingConnectionPoolAdapter) BindSelect(ctx context.Context, binder Binder, statement string, parameters ...any) error {
4040
return this.selector.BindSelect(ctx, binder, statement, parameters...)
4141
}

binding_connection_pool_adapter_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,5 +83,5 @@ func (this *BindingConnectionPoolAdapterFixture) TestBindSelect() {
8383
this.So(err, should.Equal, this.inner.selectError)
8484
this.So(this.inner.selectCalls, should.Equal, 1)
8585
this.So(this.inner.selectStatement, should.Equal, "query")
86-
this.So(this.inner.selectParameters, should.Resemble, []interface{}{1, 2, 3})
86+
this.So(this.inner.selectParameters, should.Resemble, []any{1, 2, 3})
8787
}

binding_selector_adapter.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ func NewBindingSelectorAdapter(selector Selector, panicOnBindError bool) *Bindin
1111
return &BindingSelectorAdapter{selector: selector, panicOnBindError: panicOnBindError}
1212
}
1313

14-
func (this *BindingSelectorAdapter) BindSelect(ctx context.Context, binder Binder, statement string, parameters ...interface{}) error {
14+
func (this *BindingSelectorAdapter) BindSelect(ctx context.Context, binder Binder, statement string, parameters ...any) error {
1515
result, err := this.selector.Select(ctx, statement, parameters...)
1616
if err != nil {
1717
return err

binding_selector_adapter_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ func (this *BindingSelectorAdapterFixture) TestFailedSelectReturnsError() {
3737
this.So(err, should.Equal, this.fakeInnerSelector.selectError)
3838
this.So(this.fakeInnerSelector.selects, should.Equal, 1)
3939
this.So(this.fakeInnerSelector.statement, should.Equal, "query")
40-
this.So(this.fakeInnerSelector.parameters, should.Resemble, []interface{}{1, 2, 3})
40+
this.So(this.fakeInnerSelector.parameters, should.Resemble, []any{1, 2, 3})
4141
}
4242

4343
func (this *BindingSelectorAdapterFixture) TestEmptyResult() {
@@ -93,12 +93,12 @@ func (this *BindingSelectorAdapterFixture) TestScanErrorClosesAndPanicsWhenConfi
9393
type FakeSelector struct {
9494
selects int
9595
statement string
96-
parameters []interface{}
96+
parameters []any
9797
selectResult *FakeSelectResult
9898
selectError error
9999
}
100100

101-
func (this *FakeSelector) Select(_ context.Context, statement string, parameters ...interface{}) (SelectResult, error) {
101+
func (this *FakeSelector) Select(_ context.Context, statement string, parameters ...any) (SelectResult, error) {
102102
this.selects++
103103
this.statement = statement
104104
this.parameters = parameters

binding_transaction_adapter.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@ func NewBindingTransactionAdapter(actual Transaction, panicOnBindError bool) *Bi
1414
}
1515
}
1616

17-
func (this *BindingTransactionAdapter) BindSelect(ctx context.Context, binder Binder, statement string, parameters ...interface{}) error {
17+
func (this *BindingTransactionAdapter) BindSelect(ctx context.Context, binder Binder, statement string, parameters ...any) error {
1818
return this.selector.BindSelect(ctx, binder, statement, parameters...)
1919
}

binding_transaction_adapter_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,5 +65,5 @@ func (this *BindingTransactionAdapterFixture) TestBindSelect() {
6565
this.So(err, should.Equal, this.inner.selectError)
6666
this.So(this.inner.selectCalls, should.Equal, 1)
6767
this.So(this.inner.selectStatement, should.Equal, "query")
68-
this.So(this.inner.selectParameters, should.Resemble, []interface{}{1, 2, 3})
68+
this.So(this.inner.selectParameters, should.Resemble, []any{1, 2, 3})
6969
}

doc_test.go

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,13 @@ type FakeConnectionPool struct {
2020

2121
selectCalls int
2222
selectStatement string
23-
selectParameters []interface{}
23+
selectParameters []any
2424
selectResult *FakeSelectResult
2525
selectError error
2626

2727
executeCalls int
2828
executeStatement string
29-
executeParameters []interface{}
29+
executeParameters []any
3030
executeResult uint64
3131
executeError error
3232
}
@@ -46,14 +46,14 @@ func (this *FakeConnectionPool) Close() error {
4646
return this.closeError
4747
}
4848

49-
func (this *FakeConnectionPool) Execute(_ context.Context, statement string, parameters ...interface{}) (uint64, error) {
49+
func (this *FakeConnectionPool) Execute(_ context.Context, statement string, parameters ...any) (uint64, error) {
5050
this.executeCalls++
5151
this.executeStatement = statement
5252
this.executeParameters = parameters
5353
return this.executeResult, this.executeError
5454
}
5555

56-
func (this *FakeConnectionPool) Select(_ context.Context, statement string, parameters ...interface{}) (SelectResult, error) {
56+
func (this *FakeConnectionPool) Select(_ context.Context, statement string, parameters ...any) (SelectResult, error) {
5757
this.selectCalls++
5858
this.selectStatement = statement
5959
this.selectParameters = parameters
@@ -71,13 +71,13 @@ type FakeTransaction struct {
7171

7272
selectCalls int
7373
selectStatement string
74-
selectParameters []interface{}
74+
selectParameters []any
7575
selectResult *FakeSelectResult
7676
selectError error
7777

7878
executeCalls int
7979
executeStatement string
80-
executeParameters []interface{}
80+
executeParameters []any
8181
executeResult uint64
8282
executeError error
8383
}
@@ -92,14 +92,14 @@ func (this *FakeTransaction) Rollback() error {
9292
return this.rollbackError
9393
}
9494

95-
func (this *FakeTransaction) Execute(_ context.Context, statement string, parameters ...interface{}) (uint64, error) {
95+
func (this *FakeTransaction) Execute(_ context.Context, statement string, parameters ...any) (uint64, error) {
9696
this.executeCalls++
9797
this.executeStatement = statement
9898
this.executeParameters = parameters
9999
return this.executeResult, this.executeError
100100
}
101101

102-
func (this *FakeTransaction) Select(_ context.Context, statement string, parameters ...interface{}) (SelectResult, error) {
102+
func (this *FakeTransaction) Select(_ context.Context, statement string, parameters ...any) (SelectResult, error) {
103103
this.selectCalls++
104104
this.selectStatement = statement
105105
this.selectParameters = parameters
@@ -135,7 +135,7 @@ func (this *FakeSelectResult) Close() error {
135135
return this.closeError
136136
}
137137

138-
func (this *FakeSelectResult) Scan(_ ...interface{}) error {
138+
func (this *FakeSelectResult) Scan(_ ...any) error {
139139
this.scanCalls++
140140
return this.scanError
141141
}
@@ -146,10 +146,10 @@ type FakeExecutor struct {
146146
affected uint64
147147
errorsToReturn []error
148148
statements []string
149-
parameters [][]interface{}
149+
parameters [][]any
150150
}
151151

152-
func (this *FakeExecutor) Execute(_ context.Context, statement string, parameters ...interface{}) (uint64, error) {
152+
func (this *FakeExecutor) Execute(_ context.Context, statement string, parameters ...any) (uint64, error) {
153153
this.statements = append(this.statements, strings.TrimSpace(statement))
154154
this.parameters = append(this.parameters, parameters)
155155

@@ -176,13 +176,13 @@ type FakeBindingConnectionPool struct {
176176
selectCalls int
177177
selectBinder Binder
178178
selectStatement string
179-
selectParameters []interface{}
179+
selectParameters []any
180180
selectResult *FakeSelectResult
181181
selectError error
182182

183183
executeCalls int
184184
executeStatement string
185-
executeParameters []interface{}
185+
executeParameters []any
186186
executeResult uint64
187187
executeError error
188188
}
@@ -202,14 +202,14 @@ func (this *FakeBindingConnectionPool) Close() error {
202202
return this.closeError
203203
}
204204

205-
func (this *FakeBindingConnectionPool) Execute(_ context.Context, statement string, parameters ...interface{}) (uint64, error) {
205+
func (this *FakeBindingConnectionPool) Execute(_ context.Context, statement string, parameters ...any) (uint64, error) {
206206
this.executeCalls++
207207
this.executeStatement = statement
208208
this.executeParameters = parameters
209209
return this.executeResult, this.executeError
210210
}
211211

212-
func (this *FakeBindingConnectionPool) BindSelect(_ context.Context, binder Binder, statement string, parameters ...interface{}) error {
212+
func (this *FakeBindingConnectionPool) BindSelect(_ context.Context, binder Binder, statement string, parameters ...any) error {
213213
this.selectCalls++
214214
this.selectBinder = binder
215215
this.selectStatement = statement
@@ -230,11 +230,11 @@ func (this *FakeBindingTransaction) Rollback() error {
230230
panic("Not called")
231231
}
232232

233-
func (this *FakeBindingTransaction) Execute(_ context.Context, _ string, _ ...interface{}) (uint64, error) {
233+
func (this *FakeBindingTransaction) Execute(_ context.Context, _ string, _ ...any) (uint64, error) {
234234
panic("Not called")
235235
}
236236

237-
func (this *FakeBindingTransaction) BindSelect(_ context.Context, _ Binder, _ string, _ ...interface{}) error {
237+
func (this *FakeBindingTransaction) BindSelect(_ context.Context, _ Binder, _ string, _ ...any) error {
238238
panic("Not called")
239239
}
240240

interfaces.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@ type (
1919
}
2020

2121
Executor interface {
22-
Execute(context.Context, string, ...interface{}) (uint64, error)
22+
Execute(context.Context, string, ...any) (uint64, error)
2323
}
2424

2525
Selector interface {
26-
Select(context.Context, string, ...interface{}) (SelectResult, error)
26+
Select(context.Context, string, ...any) (SelectResult, error)
2727
}
2828

2929
SelectExecutor interface {
@@ -39,7 +39,7 @@ type (
3939
}
4040

4141
Scanner interface {
42-
Scan(...interface{}) error
42+
Scan(...any) error
4343
}
4444
)
4545

@@ -60,7 +60,7 @@ type (
6060
}
6161

6262
BindingSelector interface {
63-
BindSelect(context.Context, Binder, string, ...interface{}) error
63+
BindSelect(context.Context, Binder, string, ...any) error
6464
}
6565

6666
Binder func(Scanner) error

library_connection_pool_adapter.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ func (this *LibraryConnectionPoolAdapter) BeginTransaction(ctx context.Context)
2626
}
2727
}
2828

29-
func (this *LibraryConnectionPoolAdapter) Execute(ctx context.Context, query string, parameters ...interface{}) (uint64, error) {
29+
func (this *LibraryConnectionPoolAdapter) Execute(ctx context.Context, query string, parameters ...any) (uint64, error) {
3030
if result, err := this.DB.ExecContext(ctx, query, parameters...); err != nil {
3131
return 0, err
3232
} else {
@@ -35,6 +35,6 @@ func (this *LibraryConnectionPoolAdapter) Execute(ctx context.Context, query str
3535
}
3636
}
3737

38-
func (this *LibraryConnectionPoolAdapter) Select(ctx context.Context, query string, parameters ...interface{}) (SelectResult, error) {
38+
func (this *LibraryConnectionPoolAdapter) Select(ctx context.Context, query string, parameters ...any) (SelectResult, error) {
3939
return this.DB.QueryContext(ctx, query, parameters...)
4040
}

library_transaction_adapter.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ func NewLibraryTransactionAdapter(actual *sql.Tx) *LibraryTransactionAdapter {
1313
return &LibraryTransactionAdapter{Tx: actual}
1414
}
1515

16-
func (this *LibraryTransactionAdapter) Execute(ctx context.Context, query string, parameters ...interface{}) (uint64, error) {
16+
func (this *LibraryTransactionAdapter) Execute(ctx context.Context, query string, parameters ...any) (uint64, error) {
1717
if result, err := this.Tx.ExecContext(ctx, query, parameters...); err != nil {
1818
return 0, err
1919
} else {
@@ -22,6 +22,6 @@ func (this *LibraryTransactionAdapter) Execute(ctx context.Context, query string
2222
}
2323
}
2424

25-
func (this *LibraryTransactionAdapter) Select(ctx context.Context, query string, parameters ...interface{}) (SelectResult, error) {
25+
func (this *LibraryTransactionAdapter) Select(ctx context.Context, query string, parameters ...any) (SelectResult, error) {
2626
return this.Tx.QueryContext(ctx, query, parameters...)
2727
}

0 commit comments

Comments
 (0)