github.com/profzone/eden-framework@v1.0.10/pkg/reflectx/helper.go (about)

     1  package reflectx
     2  
     3  import (
     4  	"reflect"
     5  )
     6  
     7  func MustCanSetStruct(rv reflect.Value) {
     8  	if !rv.CanSet() || rv.Type().Kind() != reflect.Struct {
     9  		panic("need struct which can be set")
    10  	}
    11  }