Files
2026-09-15 21:27:46 +05:00

18 lines
311 B
Go

package internal
import (
"fmt"
"strings"
)
// StructName returns a normalized name of the passed structure.
func StructName(v interface{}) string {
if s, ok := v.(fmt.Stringer); ok {
return s.String()
}
s := fmt.Sprintf("%T", v)
// trim the pointer marker, if any
return strings.TrimLeft(s, "*")
}