title: What are the differences between a *string and a string in Golang?
body: <p><strong>Aim:</strong> understanding the difference between <code>*string</code> and <code>string</code> in Golang</p>
  
  <hr>
  
  <p><strong>Attempt</strong></p>
  
  <pre><code>func passArguments() {
      username := flag.String("user", "root", "Username for this server")
      flag.Parse()
      fmt.Printf("Your username is %q.", *username)
      fmt.Printf("Your username is %q.", username)
  }
  </code></pre>
  
  <p>results in:</p>
  
  <pre><code>Your username is "root".Your username is %!q(*string=0xc820072200)
  </code></pre>
  
  <p>but when the *string is assigned to a string:</p>
  
  <pre><code>bla:=*username
  fmt.Printf("Your username is %q.", bla)
  </code></pre>
  
  <p>it is able to print the string again:</p>
  
  <pre><code>Your username is "root".Your username is %!q(*string=0xc8200781f0).Your username is "root".
  </code></pre>
  
  <hr>
  
  <p><strong>Questions</strong></p>
  
  <ol>
  <li>Why is a *string != string, e.g. display of: <code>"root"</code> vs.
  <code>%!q(*string=0xc8200781f0)</code>? </li>
  <li>In what other cases should a *string be
  used instead of a string and why? </li>
  <li>Why is it possible to assign a
  *string to a string variable, while the display of the string is different, e.g. display of: <code>"root"</code> vs.
  <code>%!q(*string=0xc8200781f0)</code>?</li>
  </ol>