Skip to content

Commit 18950bb

Browse files
authored
👻 using any instead of interface{} introduced in Go 1.18. (#775)
Consistently use _any_ keyword. Signed-off-by: Jeff Ortel <[email protected]>
1 parent 3989d3e commit 18950bb

File tree

5 files changed

+17
-17
lines changed

5 files changed

+17
-17
lines changed

api/context.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ func (r *Context) Status(status int) {
5353
}
5454

5555
// Respond sets the values to respond to the request with.
56-
func (r *Context) Respond(status int, body interface{}) {
56+
func (r *Context) Respond(status int, body any) {
5757
r.Response = Response{
5858
Status: status,
5959
Body: body,

database/pk.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ func (r *PkSequence) session(in *gorm.DB) (out *gorm.DB) {
8282
ConnPool: in.Statement.ConnPool,
8383
Context: in.Statement.Context,
8484
Clauses: map[string]clause.Clause{},
85-
Vars: make([]interface{}, 0, 8),
85+
Vars: make([]any, 0, 8),
8686
}
8787
return
8888
}

docs/binding.txt

+13-13
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ func (h *AppFacts) List() (list []api.Fact, err error)
7878
func (h *AppFacts) Replace(facts []api.Fact) (err error)
7979
Replace facts.
8080

81-
func (h *AppFacts) Set(key string, value interface{}) (err error)
81+
func (h *AppFacts) Set(key string, value any) (err error)
8282
Set a fact (created as needed).
8383

8484
func (h *AppFacts) Source(source string)
@@ -178,19 +178,19 @@ func (r *Client) Delete(path string, params ...Param) (err error)
178178
func (r *Client) FileGet(path, destination string) (err error)
179179
FileGet downloads a file.
180180

181-
func (r *Client) FilePut(path, source string, object interface{}) (err error)
181+
func (r *Client) FilePut(path, source string, object any) (err error)
182182
FilePut uploads a file. Returns the created File resource.
183183

184-
func (r *Client) FileSend(path, method string, fields []Field, object interface{}) (err error)
184+
func (r *Client) FileSend(path, method string, fields []Field, object any) (err error)
185185
FileSend sends file upload from.
186186

187-
func (r *Client) Get(path string, object interface{}, params ...Param) (err error)
187+
func (r *Client) Get(path string, object any, params ...Param) (err error)
188188
Get a resource.
189189

190-
func (r *Client) Post(path string, object interface{}) (err error)
190+
func (r *Client) Post(path string, object any) (err error)
191191
Post a resource.
192192

193-
func (r *Client) Put(path string, object interface{}, params ...Param) (err error)
193+
func (r *Client) Put(path string, object any, params ...Param) (err error)
194194
Put a resource.
195195

196196
func (r *Client) Reset()
@@ -262,7 +262,7 @@ type Param struct {
262262
}
263263
Param.
264264

265-
type Params map[string]interface{}
265+
type Params map[string]any
266266
Params mapping.
267267

268268
type Path string
@@ -313,7 +313,7 @@ type Setting struct {
313313
func (h *Setting) Bool(key string) (b bool, err error)
314314
Bool setting value.
315315

316-
func (h *Setting) Get(key string, v interface{}) (err error)
316+
func (h *Setting) Get(key string, v any) (err error)
317317
Get a setting by key.
318318

319319
func (h *Setting) Int(key string) (n int, err error)
@@ -384,7 +384,7 @@ type Task struct {
384384
}
385385
Task API.
386386

387-
func (h *Task) Activity(entry string, x ...interface{})
387+
func (h *Task) Activity(entry string, x ...any)
388388
Activity report addon activity. The description can be a printf style
389389
format.
390390

@@ -397,13 +397,13 @@ func (h *Task) Bucket() (b *Bucket)
397397
func (h *Task) Completed(n int)
398398
Completed report addon completed (N) items.
399399

400-
func (h *Task) Data() (d map[string]interface{})
400+
func (h *Task) Data() (d map[string]any)
401401
Data returns the addon data.
402402

403-
func (h *Task) DataWith(object interface{}) (err error)
403+
func (h *Task) DataWith(object any) (err error)
404404
DataWith populates the addon data object.
405405

406-
func (h *Task) Failed(reason string, x ...interface{})
406+
func (h *Task) Failed(reason string, x ...any)
407407
Failed report addon failed. The reason can be a printf style format.
408408

409409
func (h *Task) Increment()
@@ -412,7 +412,7 @@ func (h *Task) Increment()
412412
func (h *Task) Load()
413413
Load a task by ID.
414414

415-
func (h *Task) Result(object interface{})
415+
func (h *Task) Result(object any)
416416
Result report addon result.
417417

418418
func (h *Task) Started()

hack/next-migration.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ func (r Migration) Apply(db *gorm.DB) (err error) {
5757
return
5858
}
5959
60-
func (r Migration) Models() []interface{} {
60+
func (r Migration) Models() []any {
6161
return model.All()
6262
}
6363
EOF

migration/v15/migrate.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,6 @@ func (r Migration) Apply(db *gorm.DB) (err error) {
1515
return
1616
}
1717

18-
func (r Migration) Models() []interface{} {
18+
func (r Migration) Models() []any {
1919
return model.All()
2020
}

0 commit comments

Comments
 (0)