On Wednesday, 15 April 2020 17:58:11 UTC+2, Marvin Renich wrote:
>
> In the Go tour at https://tour.golang.org/methods/19 it says 
>
>   The error type is a built-in interface similar to fmt.Stringer: 
>
> The words closest to "similar to" are "built-in interface", implying 
> that the way error is similar to fmt.Stringer is that it is a built-in 
> interface, which it clearly isn't.  I would be surprised if this is not 
> a source of confusion to a significant number of programmers who are new 
> to go and using the tour to get acquainted. 
>

I agree that this might be misunderstood in the sense of fmt.Stringer
being built-in too, but if this is commonly misunderstood it probably
is not a long-lasting, problematic confusion (for most purposes it
simply doesn't matter wether fmt.String is a predeclared built-in or
declared in the stdlib).
 

> A much better wording would be 
>
>   The error type is a built-in interface; its definition is similar to 
>   fmt.Stringer: 
>

I think I disagree here. The similarity of error and fmt.Stringer is
both being a one-method interface and this method has the same
signature for both (no arguments, string return) but their _actual_
"definition" is pretty different as one is built-in, the other isn't.

V. 

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/2501221d-c555-40b0-9648-b4b8bc54377a%40googlegroups.com.

Reply via email to