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

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