title: How to pass integer as pointer using interface{} to function
body: <p>I thought this is a simple thing to do, but I was wrong. I can't pass <code>integer</code> as pointer to function using <code>interface{}</code>.</p>
  
  <p>Example:</p>
  
  <pre><code>var test int
  someChange(&amp;test)
  fmt.Printf("after function: %d", test)
  
  func someChange(i interface{}) error{
      newFunnyValue := 42
      i = newFunnyValue
      fmt.Printf("hello from someChange now value test is: %d" , i)
      return nil //change gone ok, so nil
  }
  </code></pre>
  
  <p>And result:</p>
  
  <pre><code> hello from someChange now value test is: 42 
   after function: 0
  </code></pre>
  
  <p>I read that <code>interface{}</code> is similar to <code>void*</code> so above code should work but it's not, why? I want to add that if I pass some object which is a struct, everything works good.</p>
  
  <p>Do I have to wrap <code>int</code> in some struct?</p>
  
  <p>Edit: </p>
  
  <p><a href="https://play.golang.org/p/rg1vabug0P" rel="nofollow noreferrer">https://play.golang.org/p/rg1vabug0P</a></p>