Golang go/scanner.Error.Error() function example

package go/scanner

Error implements the error interface.

Golang go/scanner.Error.Error() function usage example

 if list, ok := err.(scanner.ErrorList); ok {
 for _, e := range list {
 fmt.Println(e.Error())
 }
 } else {
 fmt.Println(err.Error())
 }

Reference :

http://golang.org/pkg/go/scanner/#Error.Error

Advertisement