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

     1  package errcore
     2  
     3  import "fmt"
     4  
     5  func VarMapStrings(
     6  	mappedItems map[string]interface{},
     7  ) []string {
     8  	if len(mappedItems) == 0 {
     9  		return []string{}
    10  	}
    11  
    12  	items := make([]string, len(mappedItems))
    13  
    14  	index := 0
    15  	for k, v := range mappedItems {
    16  		items[index] = fmt.Sprintf(
    17  			keyValFormat,
    18  			k,
    19  			v)
    20  		index++
    21  	}
    22  
    23  	return items
    24  }