Skip to content
Myr

Change 'interface{}' to 'any' (#4308)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Gabriel Marin · committed by GitHub · parent aefb9a5 · Browse files · 3 files+4 added−4 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

3 files+4 added−4 removed

  • other:+4 added−4 removed

3 files+4 added−4 removed

modified:src/tui/tcell_test.go+1 added-1 removed
8 unmodified lines
9 "github.com/gdamore/tcell/v2"10 "github.com/junegunn/fzf/src/util"11)1213func assert(t *testing.T, context string, got interface{}, want interface{}) bool {13func assert(t *testing.T, context string, got any, want any) bool {14 if got == want {15 return true16 } else {17 t.Errorf("%s = (%T)%v, want (%T)%v", context, got, got, want, want)
378 unmodified lines
modified:src/util/eventbox.go+2 added-2 removed
4 unmodified lines
5// EventType is the type for fzf events6type EventType int78// Events is a type that associates EventType to any data9type Events map[EventType]interface{}9type Events map[EventType]any1011// EventBox is used for coordinating events12type EventBox struct {13 events Events
21 unmodified lines
35 b.cond.L.Unlock()36}3738// Set turns on the event type on the box39func (b *EventBox) Set(event EventType, value interface{}) {39func (b *EventBox) Set(event EventType, value any) {40 b.cond.L.Lock()41 b.events[event] = value42 if _, found := b.ignore[event]; !found {43 b.cond.Broadcast()
53 unmodified lines
modified:src/terminal_test.go+1 added-1 removed
563 unmodified lines
564 return item.AsString(true)565}566567// Helper function to parse, execute and convert "text/template" to string. Panics on error.568func templateToString(format string, data interface{}) string {568func templateToString(format string, data any) string {569 bb := &bytes.Buffer{}570571 err := template.Must(template.New("").Parse(format)).Execute(bb, data)572 if err != nil {
120 unmodified lines