title: golang: return a pointer or pass a reference
body: <p>What is the best way to "build" an object.</p>
  
  <p>Leme write some code:</p>
  
  <pre><code>type Car struct {
     Wheels int
     Doors  int
  } 
  </code></pre>
  
  <p>This cars are stored somewhere, somehow. So should my interface be the type of </p>
  
  <pre><code>func (s Store) GetCar() *Car
  </code></pre>
  
  <p>or should I make it</p>
  
  <pre><code>func (s Store) GetCar(*Car)
  </code></pre>
  
  <p>and pass a reference to a variable?</p>
  
  <p>Im looking for some sort of rule of thumb.</p>
  
  <p>Thanks!</p>