News for hackers. Stuff that matters.
Re:Go 1.1 is released by kibibu on Monday May 13, 2013 @07:50PM (#5702197)
You need a little more than that, unfortunately.

A quick example: the standard library `flag` package lets you parse command line arguments, and returns either pointers or values. You need to know which is which. It's easy, for example, to do this:

    var filename = flag.String("file", "default.txt", "file to open")
    fmt.Println("Using file ", filename)
The above code looks ok at first glance, but prints the address of filename rather than its value. It can be fixed by using `flag.StringVal` instead of `flag.String`, or dereferencing `filename` using `* filename` in the Println.

So I would say you need to know way less about pointers than C but you still need to know the difference.

http://golang.org/pkg/flag/

There are no comments on this comment yet.