Re: [go-nuts] Does fmt.Print* automatically render an error string in as struct (play link)

2018-08-29 Thread 'Borman, Paul' via golang-nuts
demonstrating that t is in fact an error (was well as a thing). -Paul From: on behalf of Louki Sumirniy Date: Tuesday, August 28, 2018 at 7:16 PM To: golang-nuts Subject: [go-nuts] Does fmt.Print* automatically render an error string in as struct (play link) I discovered quite by accident

[go-nuts] Does fmt.Print* automatically render an error string in as struct (play link)

2018-08-28 Thread Louki Sumirniy
I discovered quite by accident and now I can't find anything saying as such, but this example package main import ( "fmt" "errors" ) type Thing struct { err error } type thing interface { Error() string } func (t *Thing) Error() string { return t.err.Error() } func main() { t :=