将任何输入转化成字符串
- ToStringE
ToStringE(i interface{}) (string, error)
- ToString
ToString(v any) string
package main
import (
"fmt"
"github.com/songzhibin97/go-baseutils/base/banytostring"
)
func main() {
v := "test"
nv, err := anytostring.ToStringE(v)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(nv) // test
v = "test"
fmt.Println(anytostring.ToString(v)) // test
}