title: Get underlying reflect.Value from interface{}
body: <p>I'm trying to write a function that returns the underlying reflect.Value within empty interface{} by providing the underlying type using reflect.Type:</p>
  
  <pre><code>// code in: https://play.golang.org/p/p6NLm18LjzM
  package main
  
  import (
      "fmt"
      "reflect"
  )
  
  type MyInt struct{
      x int
  }
  
  func getUnderlyingAsValue( data interface{}, underlyingType reflect.Type) reflect.Value{
  
      underlyingData := data.(underlyingType) // &lt;-- Doesn't compile "underlyingType is not a type"
      return reflect.ValueOf(underlyingData)
  
  }
  
  func main() {
  
      var i int
      i = 5
      myInt := &amp;MyInt{x:i}
  
      underVal := getUnderlyingAsValue(myInt, reflect.TypeOf(i))
  
      if underVal.Type() != reflect.TypeOf(myInt){
          fmt.Printf("Doesn't Work! :-(")
      } else {
          fmt.Printf("SUCCESS!")
      }
  }
  </code></pre>
  
  <p>As written within the code, type assertion doesn't work because "reflect.Type" is not a type.</p>
  
  <p>Does anyone have any idea how to solve it? Preferably without going into uintptr in the underlying structure of an interface (if there is such a way).</p>
  
  <p>Thanks!</p>