MCPcopy Create free account
hub / github.com/brimdata/super / String

Function String

sup/formatter.go:83–95  ·  view source on GitHub ↗
(p any)

Source from the content-addressed store, hash-verified

81}
82
83func String(p any) string {
84 if typ, ok := p.(super.Type); ok {
85 return FormatType(typ)
86 }
87 switch val := p.(type) {
88 case *super.Value:
89 return FormatValue(*val)
90 case super.Value:
91 return FormatValue(val)
92 default:
93 panic(fmt.Sprintf("sup.String takes a super.Type or *super.Value: %T", val))
94 }
95}
96
97func (f *Formatter) Format(val super.Value) string {
98 f.builder.Reset()

Callers 15

fromConstMethod · 0.92
TestInterfaceBSUPMarshalFunction · 0.92
TestInterfaceUnmarshalFunction · 0.92
TestBindingsFunction · 0.92
TestEmptyInterfaceFunction · 0.92
TestNamedNormalFunction · 0.92
TestEmbeddedInterfaceFunction · 0.92
TestSUPBuilderFunction · 0.92
panicCoercionFailFunction · 0.92
PullMethod · 0.92
EvalMethod · 0.92

Calls 2

FormatTypeFunction · 0.85
FormatValueFunction · 0.70

Tested by 11

TestInterfaceBSUPMarshalFunction · 0.74
TestInterfaceUnmarshalFunction · 0.74
TestBindingsFunction · 0.74
TestEmptyInterfaceFunction · 0.74
TestNamedNormalFunction · 0.74
TestEmbeddedInterfaceFunction · 0.74
TestSUPBuilderFunction · 0.74
TestCSUPBatchBugFunction · 0.74
TestReadOneLineNoEOFFunction · 0.74