Golang go/scanner.ErrorList.Add() and Len() functions examples

package go/scanner

Add adds an Error with given position and error message to an ErrorList.

ErrorList implements the sort Interface.

Golang go/scanner.ErrorList.Add() and Len() functions usage examples

 if err != nil {
 errorList.Add(err.Pos, err.Msg)
 continue
 }

 if errorList.Len() != 0 {
 return errorList
 }

References :

http://golang.org/pkg/go/scanner/#ErrorList.Len

http://golang.org/pkg/go/scanner/#ErrorList.Add

Advertisement