diff --git a/server/common.go b/server/common.go index 77cfe40..39fc5cd 100644 --- a/server/common.go +++ b/server/common.go @@ -6,9 +6,9 @@ import ( "github.com/labstack/echo/v4" ) -func composeResponse(data interface{}) interface{} { +func composeResponse(data any) any { type R struct { - Data interface{} `json:"data"` + Data any `json:"data"` } return R{ diff --git a/store/db/migration_history.go b/store/db/migration_history.go index 5906e52..472bfb5 100644 --- a/store/db/migration_history.go +++ b/store/db/migration_history.go @@ -54,7 +54,7 @@ func (db *DB) UpsertMigrationHistory(ctx context.Context, upsert *MigrationHisto } func findMigrationHistoryList(ctx context.Context, tx *sql.Tx, find *MigrationHistoryFind) ([]*MigrationHistory, error) { - where, args := []string{"1 = 1"}, []interface{}{} + where, args := []string{"1 = 1"}, []any{} if v := find.Version; v != nil { where, args = append(where, "version = ?"), append(args, *v) diff --git a/store/shortcut.go b/store/shortcut.go index c731499..7199fad 100644 --- a/store/shortcut.go +++ b/store/shortcut.go @@ -207,7 +207,7 @@ func createShortcut(ctx context.Context, tx *sql.Tx, create *api.ShortcutCreate) } func patchShortcut(ctx context.Context, tx *sql.Tx, patch *api.ShortcutPatch) (*shortcutRaw, error) { - set, args := []string{}, []interface{}{} + set, args := []string{}, []any{} if v := patch.Name; v != nil { set, args = append(set, "name = ?"), append(args, *v) @@ -250,7 +250,7 @@ func patchShortcut(ctx context.Context, tx *sql.Tx, patch *api.ShortcutPatch) (* } func findShortcutList(ctx context.Context, tx *sql.Tx, find *api.ShortcutFind) ([]*shortcutRaw, error) { - where, args := []string{"1 = 1"}, []interface{}{} + where, args := []string{"1 = 1"}, []any{} if v := find.ID; v != nil { where, args = append(where, "id = ?"), append(args, *v) @@ -333,7 +333,7 @@ func findShortcutList(ctx context.Context, tx *sql.Tx, find *api.ShortcutFind) ( } func deleteShortcut(ctx context.Context, tx *sql.Tx, delete *api.ShortcutDelete) error { - where, args := []string{"1 = 1"}, []interface{}{} + where, args := []string{"1 = 1"}, []any{} if v := delete.ID; v != nil { where, args = append(where, "id = ?"), append(args, *v) diff --git a/store/user.go b/store/user.go index 1c465c4..1df2a05 100644 --- a/store/user.go +++ b/store/user.go @@ -194,7 +194,7 @@ func createUser(ctx context.Context, tx *sql.Tx, create *api.UserCreate) (*userR } func patchUser(ctx context.Context, tx *sql.Tx, patch *api.UserPatch) (*userRaw, error) { - set, args := []string{}, []interface{}{} + set, args := []string{}, []any{} if v := patch.RowStatus; v != nil { set, args = append(set, "row_status = ?"), append(args, *v) @@ -253,7 +253,7 @@ func patchUser(ctx context.Context, tx *sql.Tx, patch *api.UserPatch) (*userRaw, } func findUserList(ctx context.Context, tx *sql.Tx, find *api.UserFind) ([]*userRaw, error) { - where, args := []string{"1 = 1"}, []interface{}{} + where, args := []string{"1 = 1"}, []any{} if v := find.ID; v != nil { where, args = append(where, "id = ?"), append(args, *v) diff --git a/store/user_setting.go b/store/user_setting.go index b243977..efbd222 100644 --- a/store/user_setting.go +++ b/store/user_setting.go @@ -108,7 +108,7 @@ func upsertUserSetting(ctx context.Context, tx *sql.Tx, upsert *api.UserSettingU } func findUserSettingList(ctx context.Context, tx *sql.Tx, find *api.UserSettingFind) ([]*userSettingRaw, error) { - where, args := []string{"1 = 1"}, []interface{}{} + where, args := []string{"1 = 1"}, []any{} if v := find.Key; v != nil { where, args = append(where, "key = ?"), append(args, v.String()) diff --git a/store/workspace.go b/store/workspace.go index 8d77af1..7c2e651 100644 --- a/store/workspace.go +++ b/store/workspace.go @@ -189,7 +189,7 @@ func createWorkspace(ctx context.Context, tx *sql.Tx, create *api.WorkspaceCreat } func patchWorkspace(ctx context.Context, tx *sql.Tx, patch *api.WorkspacePatch) (*workspaceRaw, error) { - set, args := []string{}, []interface{}{} + set, args := []string{}, []any{} if v := patch.RowStatus; v != nil { set, args = append(set, "row_status = ?"), append(args, *v) @@ -244,7 +244,7 @@ func patchWorkspace(ctx context.Context, tx *sql.Tx, patch *api.WorkspacePatch) } func findWorkspaceList(ctx context.Context, tx *sql.Tx, find *api.WorkspaceFind) ([]*workspaceRaw, error) { - where, args := []string{"1 = 1"}, []interface{}{} + where, args := []string{"1 = 1"}, []any{} if v := find.ID; v != nil { where, args = append(where, "id = ?"), append(args, *v) diff --git a/store/workspace_user.go b/store/workspace_user.go index 7f56647..5f1b4b0 100644 --- a/store/workspace_user.go +++ b/store/workspace_user.go @@ -138,7 +138,7 @@ func (s *Store) DeleteWorkspaceUser(ctx context.Context, delete *api.WorkspaceUs func upsertWorkspaceUser(ctx context.Context, tx *sql.Tx, upsert *api.WorkspaceUserUpsert) (*workspaceUserRaw, error) { set := []string{"workspace_id", "user_id", "role"} - args := []interface{}{upsert.WorkspaceID, upsert.UserID, upsert.Role} + args := []any{upsert.WorkspaceID, upsert.UserID, upsert.Role} placeholder := []string{"?", "?", "?"} if v := upsert.UpdatedTs; v != nil { @@ -168,7 +168,7 @@ func upsertWorkspaceUser(ctx context.Context, tx *sql.Tx, upsert *api.WorkspaceU } func findWorkspaceUserList(ctx context.Context, tx *sql.Tx, find *api.WorkspaceUserFind) ([]*workspaceUserRaw, error) { - where, args := []string{"1 = 1"}, []interface{}{} + where, args := []string{"1 = 1"}, []any{} if v := find.WorkspaceID; v != nil { where, args = append(where, "workspace_id = ?"), append(args, *v)