Closed
Description
% cat /tmp/x.go
package main
import "fmt"
func main() {
fmt.Printf☹("hello world")
}
% go build /tmp/x.go
# command-line-arguments
/tmp/x.go:6:6: undefined: fmt.Printf☹
/tmp/x.go:6:12: invalid character U+2639 '☹' in identifier
%
The first error is irrelevant; the second error is the real problem.
I ran into this in a real program by accidentally typing a non-breaking space (U+00A0), which renders invisibly. That made the first error look even weirder:
/tmp/x.go:6:6: undefined: fmt.Printf
/tmp/x.go:6:12: invalid character U+00A0 in identifier
If the identifier has an invalid character, that should be diagnosed and there shouldn't be any other errors about it.
/cc @griesemer
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
Done