gitlab.com/evatix-go/core@v1.3.55/keymk/appendStringsWithBaseAnyItems.go (about)

     1  package keymk
     2  
     3  func appendStringsWithBaseAnyItems(
     4  	isSkipOnEmpty bool,
     5  	mainSlice []interface{},
     6  	appendingItems []string,
     7  ) []interface{} {
     8  	if len(appendingItems) == 0 {
     9  		return mainSlice
    10  	}
    11  
    12  	for _, item := range appendingItems {
    13  		if isSkipOnEmpty && item == "" {
    14  			continue
    15  		}
    16  
    17  		mainSlice = append(
    18  			mainSlice,
    19  			item)
    20  	}
    21  
    22  	return mainSlice
    23  }