Skip to content

Commit 9f7469a

Browse files
style: replace empty interface{} with any (#200)
1 parent a88fae3 commit 9f7469a

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

bot.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,15 +152,15 @@ func defaultErrorsHandler(err error) {
152152
log.Printf("[TGBOT] [ERROR] %v", err)
153153
}
154154

155-
func defaultDebugHandler(format string, args ...interface{}) {
155+
func defaultDebugHandler(format string, args ...any) {
156156
log.Printf("[TGBOT] [DEBUG] "+format, args...)
157157
}
158158

159159
func defaultHandler(_ context.Context, _ *Bot, update *models.Update) {
160160
log.Printf("[TGBOT] [UPDATE] %+v", update)
161161
}
162162

163-
func (b *Bot) error(format string, args ...interface{}) {
163+
func (b *Bot) error(format string, args ...any) {
164164
b.errorsHandler(fmt.Errorf(format, args...))
165165
}
166166

webhook_handler_test.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ type mockDebugHandler struct {
1717
messages []string
1818
}
1919

20-
func (h *mockDebugHandler) Handle(format string, args ...interface{}) {
20+
func (h *mockDebugHandler) Handle(format string, args ...any) {
2121
h.messages = append(h.messages, format)
2222
}
2323

@@ -52,7 +52,7 @@ func TestWebhookHandler_Success(t *testing.T) {
5252
bot := &Bot{
5353
updates: make(chan *models.Update, 1),
5454
isDebug: true,
55-
debugHandler: func(format string, args ...interface{}) {
55+
debugHandler: func(format string, args ...any) {
5656
debugHandler.Handle(format, args...)
5757
},
5858
errorsHandler: func(err error) {
@@ -86,7 +86,7 @@ func TestWebhookHandler_ReadBodyError(t *testing.T) {
8686
errorsHandler := &mockErrorsHandler{}
8787

8888
bot := &Bot{
89-
debugHandler: func(format string, args ...interface{}) {
89+
debugHandler: func(format string, args ...any) {
9090
debugHandler.Handle(format, args...)
9191
},
9292
errorsHandler: func(err error) {
@@ -114,7 +114,7 @@ func TestWebhookHandler_DecodeError(t *testing.T) {
114114
errorsHandler := &mockErrorsHandler{}
115115

116116
bot := &Bot{
117-
debugHandler: func(format string, args ...interface{}) {
117+
debugHandler: func(format string, args ...any) {
118118
debugHandler.Handle(format, args...)
119119
},
120120
errorsHandler: func(err error) {
@@ -144,7 +144,7 @@ func TestWebhookHandler_ContextDone(t *testing.T) {
144144

145145
bot := &Bot{
146146
updates: make(chan *models.Update, 1),
147-
debugHandler: func(format string, args ...interface{}) {
147+
debugHandler: func(format string, args ...any) {
148148
debugHandler.Handle(format, args...)
149149
},
150150
errorsHandler: func(err error) {

0 commit comments

Comments
 (0)