summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGabriel Marin <gbrlmarn@gmail.com>2025-03-11 07:24:54 +0200
committerGitHub <noreply@github.com>2025-03-11 14:24:54 +0900
commit6c104d771e382f499025a35b10f39d997ce83b7d (patch)
treee3ea07ad6f1980d393d0775607bd1195b503b0d4
parentaefb9a5bc41f92227e4bffa050caca0270b450ba (diff)
downloadfzf-6c104d771e382f499025a35b10f39d997ce83b7d.tar.gz
Change 'interface{}' to 'any' (#4308)
-rw-r--r--src/terminal_test.go2
-rw-r--r--src/tui/tcell_test.go2
-rw-r--r--src/util/eventbox.go4
3 files changed, 4 insertions, 4 deletions
diff --git a/src/terminal_test.go b/src/terminal_test.go
index 4d55d80e..1d50767b 100644
--- a/src/terminal_test.go
+++ b/src/terminal_test.go
@@ -565,7 +565,7 @@ func (item *Item) String() string {
}
// Helper function to parse, execute and convert "text/template" to string. Panics on error.
-func templateToString(format string, data interface{}) string {
+func templateToString(format string, data any) string {
bb := &bytes.Buffer{}
err := template.Must(template.New("").Parse(format)).Execute(bb, data)
diff --git a/src/tui/tcell_test.go b/src/tui/tcell_test.go
index 63bcd8ce..8efd0ad8 100644
--- a/src/tui/tcell_test.go
+++ b/src/tui/tcell_test.go
@@ -10,7 +10,7 @@ import (
"github.com/junegunn/fzf/src/util"
)
-func assert(t *testing.T, context string, got interface{}, want interface{}) bool {
+func assert(t *testing.T, context string, got any, want any) bool {
if got == want {
return true
} else {
diff --git a/src/util/eventbox.go b/src/util/eventbox.go
index b710cf1e..91b9274e 100644
--- a/src/util/eventbox.go
+++ b/src/util/eventbox.go
@@ -6,7 +6,7 @@ import "sync"
type EventType int
// Events is a type that associates EventType to any data
-type Events map[EventType]interface{}
+type Events map[EventType]any
// EventBox is used for coordinating events
type EventBox struct {
@@ -36,7 +36,7 @@ func (b *EventBox) Wait(callback func(*Events)) {
}
// Set turns on the event type on the box
-func (b *EventBox) Set(event EventType, value interface{}) {
+func (b *EventBox) Set(event EventType, value any) {
b.cond.L.Lock()
b.events[event] = value
if _, found := b.ignore[event]; !found {