gitlab.com/evatix-go/core@v1.3.55/errcore/SliceErrorsToStrings.go (about)

     1  package errcore
     2  
     3  func SliceErrorsToStrings(
     4  	errorItems ...error,
     5  ) []string {
     6  	if errorItems == nil {
     7  		return []string{}
     8  	}
     9  
    10  	slice := make([]string, 0, len(errorItems))
    11  
    12  	for _, err := range errorItems {
    13  		if err == nil {
    14  			continue
    15  		}
    16  
    17  		slice = append(slice, err.Error())
    18  	}
    19  
    20  	return slice
    21  }