title: String pointers
body: <p>Consider the following program (<a href="http://play.golang.org/p/IbAstvudtE" rel="nofollow">http://play.golang.org/p/IbAstvudtE</a>):</p>
  
  <pre><code>package main
  
  import (
      "fmt"
  )
  
  func changeStringValueNotOK(dest *string, src string) {
      dest = &amp;src
  }
  
  func changeStringValueOK(dest *string, src string) {
      *dest = src
  }
  
  func main() {
  
      a := "Hello"
      b := "World"
  
      changeStringValueNotOK(&amp;a, b)
      fmt.Println(a) // still "Hello"
  
      changeStringValueOK(&amp;a, b)
      fmt.Println(a) // now "World"
  }
  </code></pre>
  
  <p>My goal is to call a function and change the value of string. Works fine with the second function, but not with the first. </p>
  
  <p>Question: what is the meaning of <code>*dest = src</code> compared to <code>dest = &amp;src</code>? I guess the former is "the contents of dest is now src" and the latter is "change the dest variable so that it now points to the address of src" which discards the previous value, but not the contents of a. But even if I am right, I don't understand how the <code>*dest = src</code> works.</p>
  
  <p>I hope my question isn't too fuzzy.</p>