Hacker News new | past | comments | ask | show | jobs | submit login

I am on ubuntu raring with the packaged golang and I can't compile your example code, copied directly out of Sample Use.

  kbarrett@vernon-linux:~/go-work/gotk$ go version
  go version go1.0.2
  kbarrett@vernon-linux:~/go-work/gotk$ go build
  # github.com/conformal/gotk3/glib
  glib.go:380[/tmp/go-build210667265/github.com/conformal/gotk3/glib/_obj/glib.cgo1.go:370]: function ends without a return statement
  glib.go:743[/tmp/go-build210667265/github.com/conformal/gotk3/glib/_obj/glib.cgo1.go:741]: function ends without a return statement
function ends without a return statement. If this is a problem with my version of go, I will try and fetch the latest head from git. I am interested!

sudo go get github.com/conformal/gotk3/gtk -- gives the same error.




Go 1.1 improved its analysis of whether a function ends with a return statement: http://golang.org/doc/go1.1#return


Yes. I think that syntax became legal in 1.1.


I see, ubuntu's go is very old. You can tell I'm not doing this stuff every day. (It's obviously because I'm on a release from April...)

I'm going to try it on FreeBSD.


(That worked.)


If you want the latest Go version on Ubuntu : http://blog.labix.org/2013/06/15/in-flight-deb-packages-of-g...


You can also just build tip on your own locally. Go has virtually no hard dependencies other than gcc (and mercurial to get the repo, unless you pull the code some other way).

  hg clone http://code.google.com/p/go
  cd go/src
  ./make.bash
(or ./all.bash if you want to run all the unit tests)

Same holds true even on Windows if you have a local gcc like MinGW (the only notable difference is you'll execute make.bat instead of make.bash if you're in a Windows cmd shell instead of bash).


Google also distributes binaries for Linux, for me all I do is unzip the file and set up my .profile to look for go in the path it was exported in..I set this up on a per-user basis but it works fine for me.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: