github.com/nyan233/littlerpc@v0.4.6-0.20230316182519-0c8d5c48abaf/internal/reflect/utils.go (about)

     1  package reflect
     2  
     3  // 该函数用于生成各种测试需要的类型信息
     4  func getTypeInfo(fn func(k int, v interface{})) {
     5  	fn(0, *new(string))
     6  	fn(1, *new(int32))
     7  	fn(2, *new(int64))
     8  	fn(3, *new(uint32))
     9  	fn(4, *new(uint64))
    10  	fn(5, *new(float32))
    11  	fn(6, *new(float64))
    12  	fn(7, make(map[string]interface{}))
    13  	fn(8, struct {
    14  		Id   int
    15  		Name string
    16  	}{})
    17  }