package main
import fmt "fmt"
func main() { /// line 6
fmt.Printf("hello, word \n")
}
$ 8g hello.go
hello.go:6: syntax error near "<string>"
Also in the getting started hello world, it had
import "fmt"
but in the examples it has
import "fmt"
(Both give the same syntax error).
$GOOS=windows
$GOARCH=386
using binary go from http://code.google.com/p/gomingw/
update 2010-12-02
These both look the same to me. Are there any non-ascii characters in
the file? If you copy and paste this code, does it work?
package main
import "fmt"
func main() { fmt.Println("Hi") }
Andrew
In UTF-8, the same character is whitespace.
Make sure to use a Windows encoding for Go programs compiled on Windows.