title: copy pointer values *a = *b in golang
body: <pre><code>type T struct {
      Id int
      Name string
  }
  
  func Copy(a *T, b *T) error {
      b.Id=5
      b.Name="gert"
      a = b
      return nil
  }
  </code></pre>
  
  <p><code>a</code> is still empty, I have to do it like this</p>
  
  <pre><code>func Copy(a *T, b *T) error {
      b.Id = 5
      b.Name = "gert"
      a.Id = b.Id
      a.Name = b.Name
      return nil
  }
  </code></pre>
  
  <p>now <code>a</code> is the same as <code>b</code></p>
  
  <p>Why and how can I copy <code>*b</code> to <code>*a</code> directly?</p>