gitlab.com/evatix-go/core@v1.3.55/isany/DefinedItems.go (about)

     1  package isany
     2  
     3  func DefinedItems(
     4  	anyItems ...interface{},
     5  ) (isAllDefined bool, nonNullItems []interface{}) {
     6  	if len(anyItems) == 0 {
     7  		return false, nil
     8  	}
     9  
    10  	isAllDefined = true
    11  	nonNullItems = make([]interface{}, 0, len(anyItems))
    12  
    13  	for _, anyItem := range anyItems {
    14  		if Null(anyItem) {
    15  			isAllDefined = false
    16  		}
    17  
    18  		nonNullItems = append(nonNullItems, anyItem)
    19  	}
    20  
    21  	return isAllDefined, nonNullItems
    22  }