refactor: run Go modernize (#5002)

This commit is contained in:
Maximilian
2026-02-08 08:57:30 -06:00
committed by GitHub
parent 408aa78ed5
commit a704e86ac1
102 changed files with 322 additions and 352 deletions
+4 -4
View File
@@ -28,7 +28,7 @@ func newTranslationRepository(context.Context) rest.Repository {
type translationRepository struct{}
func (r *translationRepository) Read(id string) (interface{}, error) {
func (r *translationRepository) Read(id string) (any, error) {
translations, _ := loadTranslations()
if t, ok := translations[id]; ok {
return t, nil
@@ -43,7 +43,7 @@ func (r *translationRepository) Count(...rest.QueryOptions) (int64, error) {
}
// ReadAll simple implementation, only returns IDs. Does not support any `options`
func (r *translationRepository) ReadAll(...rest.QueryOptions) (interface{}, error) {
func (r *translationRepository) ReadAll(...rest.QueryOptions) (any, error) {
translations, _ := loadTranslations()
var result []translation
for _, t := range translations {
@@ -57,7 +57,7 @@ func (r *translationRepository) EntityName() string {
return "translation"
}
func (r *translationRepository) NewInstance() interface{} {
func (r *translationRepository) NewInstance() any {
return &translation{}
}
@@ -103,7 +103,7 @@ func loadTranslation(fsys fs.FS, fileName string) (translation translation, err
if err != nil {
return
}
var out map[string]interface{}
var out map[string]any
if err = json.Unmarshal(data, &out); err != nil {
return
}