gitlab.com/evatix-go/core@v1.3.55/conditional/NilCheck.go (about)

     1  package conditional
     2  
     3  func NilCheck(
     4  	canBeEmpty interface{},
     5  	onNil interface{},
     6  	onNonNil interface{},
     7  ) interface{} {
     8  	if canBeEmpty == nil {
     9  		return onNil
    10  	}
    11  
    12  	return onNonNil
    13  }