MCPcopy Index your code
hub / github.com/expr-lang/expr / messageFromMsgAndArgs

Function messageFromMsgAndArgs

internal/testify/assert/assertions.go:284–299  ·  view source on GitHub ↗
(msgAndArgs ...interface{})

Source from the content-addressed store, hash-verified

282}
283
284func messageFromMsgAndArgs(msgAndArgs ...interface{}) string {
285 if len(msgAndArgs) == 0 || msgAndArgs == nil {
286 return ""
287 }
288 if len(msgAndArgs) == 1 {
289 msg := msgAndArgs[0]
290 if msgAsStr, ok := msg.(string); ok {
291 return msgAsStr
292 }
293 return fmt.Sprintf("%+v", msg)
294 }
295 if len(msgAndArgs) > 1 {
296 return fmt.Sprintf(msgAndArgs[0].(string), msgAndArgs[1:]...)
297 }
298 return ""
299}
300
301// Aligns the provided message so that all lines after the first line start at the same location as the first line.
302// Assumes that the first line starts at the correct location (after carriage return, tab, label, spacer and tab).

Callers 1

FailFunction · 0.85

Calls 1

SprintfMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…