Re: [go-nuts] go programming book

1,413 views
Skip to first unread message

Michael Jones

unread,
Mar 14, 2013, 9:19:13 PM3/14/13
to paleop...@gmail.com, golang-nuts


On Thu, Mar 14, 2013 at 5:23 PM, <paleop...@gmail.com> wrote:
I am studying Programming in Go  Very first example on page 14 will not run

go run hello.go
package : 
hello.go:3:8: expected 'STRING', found '{'
hello.go:4:6: expected ';', found 'STRING' "fmt"

I can't find an explanation for these error messages or what to do about them


--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 



--
Michael T. Jones | Chief Technology Advocate  | m...@google.com |  +1 650-335-5765

Dave Cheney

unread,
Mar 14, 2013, 9:30:31 PM3/14/13
to Michael Jones, paleop...@gmail.com, golang-nuts
Possibly the (1) from the pdf leaked into the source, assuming you
copied and pasted from the pdf.

Herman Junge

unread,
Feb 23, 2014, 8:36:11 PM2/23/14
to golan...@googlegroups.com
Maybe you did

import {
// your imports
}

with a curly brace, instead of:

import (
// your imports
)

with parenthesis.

hj



peterGo

unread,
Feb 24, 2014, 9:18:29 AM2/24/14
to golan...@googlegroups.com
It's usually because someone copied and pasted on Windows. Go expects UTF-8 encoded source files.

What is output from:

    go version

Did you follow the instructions for downloading the source files for the book?

Programming in Go
http://www.qtrac.eu/gobook.html

Downloads

The source code is available in two formats, gobook-1.0.tar.gz[http://www.qtrac.eu/gobook-1.0.tar.gz] (70K suitable for any platform), and gobook-1.0.zip[http://www.qtrac.eu/gobook-1.0.zip] (170K Windows line endings) [updated 2013-10-09] and have been tested with Go 1.0, Go 1.1, and Go 1.2—they are subject to the very liberal Apache 2.0 license. There is also an Errata [updated 2013-06-28].

Peter
Reply all
Reply to author
Forward
0 new messages