Skip to content

Commit

Permalink
refactor: use any instead of interface{}
Browse files Browse the repository at this point in the history
  • Loading branch information
skanehira committed Aug 15, 2024
1 parent 0688b36 commit 9b8dedf
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ var rootCmd = &cobra.Command{
Use: "rtty",
}

func exitError(msg interface{}) {
func exitError(msg any) {
fmt.Fprintln(os.Stderr, msg)
os.Exit(1)
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ const (

type Message struct {
Event Event
Data interface{}
Data any
}

var ptmx *os.File
Expand Down
4 changes: 2 additions & 2 deletions cmd/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ func getenv(key, def string) string {
return def
}

func windowSize(msg interface{}) (rows, cols uint16, err error) {
data, ok := msg.(map[string]interface{})
func windowSize(msg any) (rows, cols uint16, err error) {
data, ok := msg.(map[string]any)
if !ok {
return 0, 0, fmt.Errorf("invalid message: %#+v", msg)
}
Expand Down

0 comments on commit 9b8dedf

Please sign in to comment.