Here is a simple golang script T1.go:
package main
import \"fmt\"
func main() {
fmt.Println(\"Hello world\")
}
run it with go r
Your Hex dump shows that you are using Carriage Return characters (U+000D) instead of LineFeeds (U+000A) in the T1.go
file. Using only CR as End-of-line is an old Mac way of doing it.
The specification states that a new line is a single line feed character. Since this is not found, the parser assumes it is all written on the same line. In such a case, the compiler requires that you actually type out the semi-colons.
Solution
Change your CR to LF and it should work.
If you use Notepad++, you can do this conversion in the menu Edit - EOL Conversion - Unix/OSX Format.
go fmt
does not convert CR to LF, while it does convert CRLF to LF.
The same goes for dos2unix
. In your case, it should work with mac2unix
.
Sounds like a bug in the 1.2rc1
version. Try the 1.2rc2
and see if the problem is still there.