What does the asterisk do in "Go"?

Viewed 49755

I've been going through and trying to understand the examples on the Go website and I keep coming across a special asterisk character in examples like this:

s := "hello"
if s[1] != 'e' {
    os.Exit(1)
}
s = "good bye"
var p *string = &s
*p = "ciao"

Also, I just noticed, what's with the &s? Is it assignment by reference (I might be using PHP talk here)?

6 Answers
Related