gitlab.com/evatix-go/core@v1.3.55/coredata/coredynamic/SafeZeroSet.go (about)

     1  package coredynamic
     2  
     3  import (
     4  	"reflect"
     5  
     6  	"gitlab.com/evatix-go/core/internal/reflectinternal"
     7  )
     8  
     9  func SafeZeroSet(rv reflect.Value) {
    10  	if reflectinternal.IsNull(rv) {
    11  		return
    12  	}
    13  
    14  	rv.Elem().Set(reflect.Zero(rv.Elem().Type()))
    15  }