title: When to use pointers
body: <p>I'm new to the Go Language, and have only minimal background in C/C++, so naturally I'm struggling with the idea of when to use pointers and when not to use pointers. Although this question might be considered open-ended, I'm wondering what some guidelines on when to return structs and when to return pointers, (and equivalently when to accept structs / pointers as arguments).</p>
  
  <p>From what I can guess, the following statements hold true:</p>
  
  <ol>
  <li>structs are passed into functions by value. That is, a copy of a structure is made when passing it into a function.</li>
  <li>if I want to pass a structure by reference, then I would instead use a pointer argument in the function definition, and use the addressof operator when calling the function.</li>
  <li>The reason why I would want to pass in a structure by reference is because either the structure I'm passing in is large, and it would be taxing on memory to pass it by value (unlikely) or if I want to make changes to the copy that I'm passing in (more likely).</li>
  <li>As a corollary to 3.), I should pass by value unless I have one of the reasons above to pass by reference.</li>
  </ol>
  
  <p>Are my assumptions correct? Or am I missing the mark on pointers?</p>