Taking interface{} -> any modernize bits (#4204)

This commit is contained in:
Raja Subramanian
2025-12-28 05:22:12 +05:30
committed by GitHub
parent b91cd2e4ea
commit b8ddd0f98c
24 changed files with 135 additions and 57 deletions
+5 -5
View File
@@ -46,9 +46,9 @@ type twirpLoggerKey struct{}
// License: Apache-2.0
func TwirpLogger() *twirp.ServerHooks {
loggerPool := &sync.Pool{
New: func() interface{} {
New: func() any {
return &twirpLogger{
fieldsOrig: make([]interface{}, 0, 30),
fieldsOrig: make([]any, 0, 30),
}
},
}
@@ -67,12 +67,12 @@ func TwirpLogger() *twirp.ServerHooks {
type twirpLogger struct {
twirpRequestFields
fieldsOrig []interface{}
fields []interface{}
fieldsOrig []any
fields []any
startedAt time.Time
}
func AppendLogFields(ctx context.Context, fields ...interface{}) {
func AppendLogFields(ctx context.Context, fields ...any) {
r, ok := ctx.Value(twirpLoggerKey{}).(*twirpLogger)
if !ok || r == nil {
return