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

     1  package errcore
     2  
     3  import "fmt"
     4  
     5  func MessageVarMap(
     6  	message string,
     7  	mappedItems map[string]interface{},
     8  ) string {
     9  	if len(mappedItems) == 0 {
    10  		return message
    11  	}
    12  
    13  	compiledMap := VarMap(mappedItems)
    14  
    15  	return fmt.Sprintf(
    16  		messageMapFormat,
    17  		message,
    18  		compiledMap)
    19  }