mirror of
https://github.com/kovidgoyal/kitty
synced 2026-06-08 22:28:24 +02:00
get rid of interface{} since we now require Go 1.18
This commit is contained in:
@@ -83,7 +83,7 @@ func simple_serializer(rc *utils.RemoteControlCmd) (ans []byte, err error) {
|
||||
|
||||
type serializer_func func(rc *utils.RemoteControlCmd) ([]byte, error)
|
||||
|
||||
func debug_to_log(args ...interface{}) {
|
||||
func debug_to_log(args ...any) {
|
||||
f, err := os.OpenFile("/tmp/kdlog", os.O_CREATE|os.O_APPEND|os.O_WRONLY, 0666)
|
||||
if err == nil {
|
||||
fmt.Fprintln(f, args...)
|
||||
|
||||
@@ -8,8 +8,8 @@ import (
|
||||
"strings"
|
||||
)
|
||||
|
||||
func parse_scroll_amount(amt string) ([]interface{}, error) {
|
||||
var ans = make([]interface{}, 2)
|
||||
func parse_scroll_amount(amt string) ([]any, error) {
|
||||
var ans = make([]any, 2)
|
||||
if amt == "start" || amt == "end" {
|
||||
ans[0] = amt
|
||||
ans[1] = nil
|
||||
|
||||
@@ -26,7 +26,7 @@ var nullable_colors = map[string]bool{
|
||||
// NULLABLE_COLORS_END
|
||||
}
|
||||
|
||||
func set_color_in_color_map(key, val string, ans map[string]interface{}, check_nullable, skip_nullable bool) error {
|
||||
func set_color_in_color_map(key, val string, ans map[string]any, check_nullable, skip_nullable bool) error {
|
||||
if val == "none" {
|
||||
if check_nullable && !nullable_colors[key] {
|
||||
if skip_nullable {
|
||||
@@ -45,8 +45,8 @@ func set_color_in_color_map(key, val string, ans map[string]interface{}, check_n
|
||||
return nil
|
||||
}
|
||||
|
||||
func parse_colors_and_files(args []string) (map[string]interface{}, error) {
|
||||
ans := make(map[string]interface{}, len(args))
|
||||
func parse_colors_and_files(args []string) (map[string]any, error) {
|
||||
ans := make(map[string]any, len(args))
|
||||
for _, arg := range args {
|
||||
key, val, found := utils.Cut(strings.ToLower(arg), "=")
|
||||
if found {
|
||||
|
||||
@@ -10,8 +10,8 @@ import (
|
||||
"kitty/tools/utils"
|
||||
)
|
||||
|
||||
func parse_set_spacing(args []string) (map[string]interface{}, error) {
|
||||
ans := make(map[string]interface{}, len(args))
|
||||
func parse_set_spacing(args []string) (map[string]any, error) {
|
||||
ans := make(map[string]any, len(args))
|
||||
mapper := make(map[string][]string, 32)
|
||||
types := [2]string{"margin", "padding"}
|
||||
for _, q := range types {
|
||||
|
||||
@@ -11,8 +11,8 @@ import (
|
||||
|
||||
var valid_color_names = map[string]bool{"active_fg": true, "active_bg": true, "inactive_fg": true, "inactive_bg": true}
|
||||
|
||||
func parse_tab_colors(args []string) (map[string]interface{}, error) {
|
||||
ans := make(map[string]interface{}, len(args))
|
||||
func parse_tab_colors(args []string) (map[string]any, error) {
|
||||
ans := make(map[string]any, len(args))
|
||||
for _, arg := range args {
|
||||
key, val, found := utils.Cut(strings.ToLower(arg), "=")
|
||||
if !found {
|
||||
|
||||
Reference in New Issue
Block a user