Posted on 29th April 2025|3993 views
How can I convert an error to a string?
Posted on 29th April 2025| views
The error type contains an interface in Go
type error interface {
Error() string
}
Thus, for an error err, you can call
err.Error()