gitlab.com/evatix-go/core@v1.3.55/converters/KeysValuesStringsToMap.go (about)

     1  package converters
     2  
     3  // KeysValuesStringsToMap keys nil will return empty map[string]string
     4  func KeysValuesStringsToMap(keys, values []string) map[string]string {
     5  	if keys == nil || values == nil {
     6  		return map[string]string{}
     7  	}
     8  
     9  	newArray := make(map[string]string, len(keys))
    10  
    11  	for i, key := range keys {
    12  		newArray[key] = values[i]
    13  	}
    14  
    15  	return newArray
    16  }