Standard library / go/build/constraint

go/build/constraint.SyntaxError.Error()

Returns the diagnostic text for a build expression syntax error. Expected stdout: 'unexpected token\n'.

Formal Syntax & Structure

go syntaxgo
func (e *SyntaxError) Error() string

Return Value

string

Returns the diagnostic text for a build expression syntax error.

Working Example

Example Snippetgo
package main
import (  "fmt"  "go/build/constraint")
func main() { e := constraint.SyntaxError{Offset: 3, Err: "unexpected token"}; fmt.Println(e.Error()) }
Go Reference