package util import ( "fmt" "os" ) var ( HadError bool = false ) func Error(line int, msg string) { report(line, "", msg) HadError = true } func report(line int, where string, msg string) { fmt.Fprintln(os.Stderr, "[line "+fmt.Sprint(line)+"] Error"+where+": "+msg) }