Преглед на файлове

refactor(locale): use any instead of interface{}

jvoisin преди 9 месеца
родител
ревизия
8e86004936
променени са 2 файла, в които са добавени 2 реда и са изтрити 2 реда
  1. 1 1
      internal/locale/catalog.go
  2. 1 1
      internal/locale/printer.go

+ 1 - 1
internal/locale/catalog.go

@@ -9,7 +9,7 @@ import (
 	"fmt"
 	"fmt"
 )
 )
 
 
-type translationDict map[string]interface{}
+type translationDict map[string]any
 type catalog map[string]translationDict
 type catalog map[string]translationDict
 
 
 var defaultCatalog = make(catalog, len(AvailableLanguages))
 var defaultCatalog = make(catalog, len(AvailableLanguages))

+ 1 - 1
internal/locale/printer.go

@@ -22,7 +22,7 @@ func (p *Printer) Print(key string) string {
 }
 }
 
 
 // Printf is like fmt.Printf, but using language-specific formatting.
 // Printf is like fmt.Printf, but using language-specific formatting.
-func (p *Printer) Printf(key string, args ...interface{}) string {
+func (p *Printer) Printf(key string, args ...any) string {
 	translation := key
 	translation := key
 
 
 	if dict, err := GetTranslationDict(p.language); err == nil {
 	if dict, err := GetTranslationDict(p.language); err == nil {