chore: replace interface{} with any (Go 1.18+ alias)
This commit is contained in:
parent
f413111f08
commit
8ef36f98ca
4 changed files with 5 additions and 5 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue