github.com/niubaoshu/goutils@v0.0.0-20180828035119-e8e576f66c2b/reflect/inout_test.go (about)

     1  package reflect
     2  
     3  import (
     4  	"fmt"
     5  	"reflect"
     6  	"testing"
     7  	"time"
     8  )
     9  
    10  func TestGetInAndOut(t *testing.T) {
    11  	fmt.Println(GetInAndOut(reflect.TypeOf(a)))
    12  	in, out := GetInAndOut(reflect.TypeOf(time.Now))
    13  	fmt.Println(reflect.TypeOf((*struct{ Out0 time.Time })(nil)).Elem() == out)
    14  	_ = out
    15  	_ = in
    16  }
    17  
    18  func a(i int) int {
    19  	return i
    20  }