title: Unable to retain values of golang fields when its returned to the caller of the function
body: <p>I have a function which accepts slice of values and fields as a set of optional parameters and the function maps each value to a field and returns error if any to the caller as in below</p>
  
  <pre><code>func Unmarshall(source []interface{}, dest ...interface{}) error {
      if len(source) != len(dest) {
          return errors.New("source and destination doesn't match")
      }
  
      for i, s := range source {
          dest[i] = s
      }
      return nil
  }
  </code></pre>
  
  <p>and below the code I have for the caller</p>
  
  <pre><code>for _, r := range rows.Values {
          item := entity.Item{}
          e :=Unmarshall(r,
              &amp;item.Name,
              &amp;item.Description,          
              &amp;item.AddedUTCDatetime,
              &amp;item.ModifiedUTCDatetime)
  
          if e == nil {           
              items = append(items, item)
          }
      }
  </code></pre>
  
  <p>But the issue with the above is <code>item.Name,item.Description,                &amp;item.AddedUTCDatetime, &amp;item.ModifiedUTCDatetime</code> doesn't retain the values set in the <code>Unmarshall func</code> even though I passed in the pointer to the fields.</p>
  
  <p><strong>Is there anything wrong with the above code?</strong></p>