Standard library / go/scanner

go/scanner.Error

A lexical or syntax diagnostic with a position and message. Expected stdout: 'bad\n'.

Formal Syntax & Structure

go syntaxgo
type Error struct {  Pos token.Position  Msg string}

Working Example

Example Snippetgo
package main
import (  "fmt"  "go/scanner")
func main() { e := scanner.Error{Msg: "bad"}; fmt.Println(e.Msg) }
Go Reference