github.com/hedzr/evendeep@v0.4.8/internal/tool/ptr.go (about)

     1  //go:build !go1.18
     2  // +build !go1.18
     3  
     4  package tool
     5  
     6  import "reflect"
     7  
     8  // PointerTo returns the pointer type with element t.
     9  // For example, if t represents type Foo, PointerTo(t) represents *Foo.
    10  func PointerTo(t reflect.Type) reflect.Type {
    11  	return reflect.New(t).Type()
    12  }