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

Function truncatingFormat

internal/testify/assert/assertions.go:570–577  ·  view source on GitHub ↗

truncatingFormat formats the data and truncates it if it's too long. This helps keep formatted error messages lines from exceeding the bufio.MaxScanTokenSize max line length that the go testing framework imposes.

(data interface{})

Source from the content-addressed store, hash-verified

568// This helps keep formatted error messages lines from exceeding the
569// bufio.MaxScanTokenSize max line length that the go testing framework imposes.
570func truncatingFormat(data interface{}) string {
571 value := fmt.Sprintf("%#v", data)
572 max := bufio.MaxScanTokenSize - 100 // Give us some space the type info too if needed.
573 if len(value) > max {
574 value = value[0:max] + "<... truncated>"
575 }
576 return value
577}
578
579// EqualValues asserts that two objects are equal or convertible to the same types
580// and equal.

Callers 2

Test_truncatingFormatFunction · 0.85
formatUnequalValuesFunction · 0.85

Calls 1

SprintfMethod · 0.80

Tested by 1

Test_truncatingFormatFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…