title: Using reflect, how do you initialize value of a struct pointer field?
body: <pre><code>package main
  
  import (
      "fmt"
      "reflect"
  )
  
  type A struct {
      D *int
  }
  
  func main() {
      a := &amp;A{}
      v := reflect.ValueOf(a)
      e := v.Elem()
      f := e.Field(0)
      z := reflect.Zero(f.Type().Elem())
      f.Set(z)
      fmt.Println(z)
  }
  </code></pre>
  
  <p>panic: reflect.Set: value of type int is not assignable to type *int</p>
  
  <p>how to set the *D to default value use reflect</p>