github.com/chain5j/chain5j-pkg@v1.0.7/util/reflectutil/reflect_test.go (about)

     1  // Package reflectutil
     2  //
     3  // @author: xwc1125
     4  package reflectutil
     5  
     6  import (
     7  	"fmt"
     8  	"testing"
     9  )
    10  
    11  type AA struct {
    12  	Name  string
    13  	Index int
    14  }
    15  
    16  func TestToPointer(t *testing.T) {
    17  	aa := AA{
    18  		Name:  "11",
    19  		Index: 1,
    20  	}
    21  	pointer := ToPointer(aa)
    22  	fmt.Println("===", pointer)
    23  
    24  	bb := &AA{
    25  		Name:  "22",
    26  		Index: 2,
    27  	}
    28  	delPointer := DelPointer(bb)
    29  	fmt.Println(delPointer)
    30  }