mirror of
https://codeberg.org/scip/esctl.git
synced 2026-08-24 14:24:20 +02:00
further table streamlining: work with new table api everywhere
This commit is contained in:
@@ -28,9 +28,9 @@ import (
|
||||
|
||||
// stringer returns the string representation of different types of
|
||||
// values
|
||||
func stringer(in any) string {
|
||||
func stringer(cell any) string {
|
||||
//nolint:gocritic
|
||||
switch val := in.(type) {
|
||||
switch val := cell.(type) {
|
||||
case string:
|
||||
return val
|
||||
case bool:
|
||||
@@ -60,12 +60,13 @@ func stringer(in any) string {
|
||||
case *types.Float64:
|
||||
// ignore err here, because types.Float64.MarshalJSON() never returns one
|
||||
f, _ := val.MarshalJSON()
|
||||
|
||||
return string(f)
|
||||
default:
|
||||
// Caution: this may cause a panic if the [unknown] type does
|
||||
// not implement fmt.Stringer. In this case add another case
|
||||
// to the type switch for it above.
|
||||
return in.(fmt.Stringer).String()
|
||||
return cell.(fmt.Stringer).String()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user