MCPcopy
hub / github.com/stretchr/testify / messageFromMsgAndArgs

Function messageFromMsgAndArgs

assert/assertions.go:304–319  ·  assert/assertions.go::messageFromMsgAndArgs
(msgAndArgs ...interface{})

Source from the content-addressed store, hash-verified

302}
303
304func messageFromMsgAndArgs(msgAndArgs ...interface{}) string {
305 if len(msgAndArgs) == 0 || msgAndArgs == nil {
306 return ""
307 }
308 if len(msgAndArgs) == 1 {
309 msg := msgAndArgs[0]
310 if msgAsStr, ok := msg.(string); ok {
311 return msgAsStr
312 }
313 return fmt.Sprintf("%+v", msg)
314 }
315 if len(msgAndArgs) > 1 {
316 return fmt.Sprintf(msgAndArgs[0].(string), msgAndArgs[1:]...)
317 }
318 return ""
319}
320
321// Aligns the provided message so that all lines after the first line start at the same location as the first line.
322// Assumes that the first line starts at the correct location (after carriage return, tab, label, spacer and tab).

Callers 1

FailFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected