Standard library / go/scanner

go/scanner.ErrorList.Reset()

Clears all diagnostics. Expected stdout: '0\n'.

Formal Syntax & Structure

go syntaxgo
func (p *ErrorList) Reset()

Working Example

Example Snippetgo
package main
import (  "fmt"  "go/scanner"  "go/token")
func main() {  var es scanner.ErrorList  es.Add(token.Position{Filename: "demo.go", Line: 2, Column: 1}, "second")  es.Add(token.Position{Filename: "demo.go", Line: 1, Column: 1}, "first")  es.Reset()  fmt.Println(es.Len())}
Go Reference