On Sat, 17 Feb 2018 16:05:42 -0800 (PST)
Joseph Lorenzini <jalo...@gmail.com> wrote:

> Hi all:
> 
> Per documentation:
> 
> "If an operand implements the error interface, the Error method will
> be invoked to convert the object to a string, which will then be
> formatted as required by the verb (if any)"
> 
> And this is so even if the struct implements the stringer interface.
> So if I print the struct, I get the error value. Is there anyway to
> force fmt.Print to output the struct fields, even when it implements
> the error interface? 
> 
> Thanks,
> Joe 
> 

Just use fmt.Print(v.String()) instead of fmt.Print(v)

-- 
Jamil Djadala

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to