MCPcopy Create free account
hub / github.com/google/go-cmp / formatCompactTo

Method formatCompactTo

cmp/report_text.go:121–130  ·  view source on GitHub ↗
(b []byte, d diffMode)

Source from the content-addressed store, hash-verified

119 return string(b)
120}
121func (s *textWrap) formatCompactTo(b []byte, d diffMode) ([]byte, textNode) {
122 n0 := len(b) // Original buffer length
123 b = append(b, s.Prefix...)
124 b, s.Value = s.Value.formatCompactTo(b, d)
125 b = append(b, s.Suffix...)
126 if _, ok := s.Value.(textLine); ok {
127 return b, textLine(b[n0:])
128 }
129 return b, s
130}
131func (s *textWrap) formatExpandedTo(b []byte, d diffMode, n indentMode) []byte {
132 b = append(b, s.Prefix...)
133 b = s.Value.formatExpandedTo(b, d, n)

Callers 1

StringMethod · 0.95

Calls 2

textLineTypeAlias · 0.85
formatCompactToMethod · 0.65

Tested by

no test coverage detected