title: Confusion with pointer, slices and interface{} in function arguments in go
body: <p>I've been reading about how Go passes arguments to functions via pointer vs. value.  I've been reading about the interface type. And I've been tampering with the reflect package.  But clearly, I still don't understand how it all works because of this example code here:</p>
  
  <pre><code>package main
  
  import (
    "reflect"
    "fmt"
  )
  type Business struct {
    Name string
  }
  
  func DoSomething(b []Business) {
  
    var i interface{}
    i = &amp;b
    v := reflect.ValueOf(i).Elem()
  
    for c:=0 ;c&lt;10; c++ {
  
      z := reflect.New(v.Type().Elem())
      s := reflect.ValueOf(z.Interface()).Elem()
      s.Field(0).SetString("Pizza Store "+ fmt.Sprintf("%v",c))
      v.Set(reflect.Append(v, z.Elem()))
    }
    fmt.Println(b)
  
  }
  
  func main() {
  
    business := []Business{}
    DoSomething(business)
  
  }
  </code></pre>
  
  <p>When I run this code, it will print a list of ten Business structs with the Business.Name of Pizza 0 to 9.  I understand that in my example, that my <code>DoSomething</code> function received a copy of the slice of business, and hence, the <code>business</code> variable in my main function remains unaffected by whatever <code>DoSomething</code> does.</p>
  
  <p>What I did next was change my <code>func DoSomething(b []Business)</code> to <code>func DoSomething(b interface{})</code>.  Now when I try to run my script, I get the run time error of <code>panic: reflect: Elem of invalid type on</code> on the line <code>z := reflect.New(v.Type().Elem())</code></p>
  
  <p>I noticed that with <code>DoSomething(b []Business)</code>, the variable <code>i == &amp;[]</code>.  But with <code>DoSomething(b interface{})</code>, the variable <code>i == 0xc42000e1d0</code>.  Why is the variable <code>i</code> different under these two circumstances?</p>