A minor clarification. An error is any value that implements this interface 

type error interface {
        Error() string

Functions like errors.New and fmt.Errorf return an error implementation who's 
base type (kind) is a string, but this is an implementation detail, there are 
plenty of other error implementations, like os.PathError to pick just one, 
which are a struct type containing additional details. 

Why the type of errors.New is a string probably extends back to the days before 
go 1 when we had this type

package os

type Error string

(From memory)


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