Is there a standard interface for "class which imp...
# getting-started
m
Is there a standard interface for "class which implements toString()"? Like
Stringer
in Go?
r
All classes implement
toString()
There's a default implementation that you can override.
t
yes, but when you define an interface with a
toString(): String
method, you can actually force any implementations to re-implement
toString
m
to answer Mathew: no, there isn’t. You have to write it yourself.