chore: replace interface{} with any (Go 1.18+ alias)

This commit is contained in:
Claude 2026-02-24 15:57:27 +00:00
parent f413111f08
commit 8ef36f98ca
No known key found for this signature in database
GPG key ID: AF404715446AEB41
4 changed files with 5 additions and 5 deletions

View file

@ -80,8 +80,8 @@ func runExpandStatus(cmd *cli.Command, args []string) error {
return nil
}
// toInt converts an interface{} (typically from QueryRows) to int.
func toInt(v interface{}) int {
// toInt converts an any (typically from QueryRows) to int.
func toInt(v any) int {
switch n := v.(type) {
case int:
return n

View file

@ -71,7 +71,7 @@ func runLive(cmd *cli.Command, args []string) error {
}
// sqlScalar extracts the first numeric value from a QuerySQL result.
func sqlScalar(rows []map[string]interface{}) int {
func sqlScalar(rows []map[string]any) int {
if len(rows) == 0 {
return 0
}

View file

@ -129,7 +129,7 @@ func runQuery(cmd *cli.Command, args []string) error {
return nil
}
func formatValue(v interface{}) string {
func formatValue(v any) string {
if v == nil {
return "NULL"
}

View file

@ -362,7 +362,7 @@ func extractIteration(label string) int {
return n
}
// toFloat64 converts a JSON-decoded interface{} value to float64.
// toFloat64 converts a JSON-decoded any value to float64.
// Handles float64 (standard json.Unmarshal), json.Number, and string values.
func toFloat64(v any) (float64, bool) {
switch val := v.(type) {