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

Function isValid

spq_test.go:105–122  ·  view source on GitHub ↗

isValid returns true if and only if s can be read fully without error by anyio and contains at least one value.

(s string)

Source from the content-addressed store, hash-verified

103// isValid returns true if and only if s can be read fully without error by
104// anyio and contains at least one value.
105func isValid(s string) bool {
106 zrc, err := anyio.NewReader(super.NewContext(), strings.NewReader(s), anyio.ReaderOpts{})
107 if err != nil {
108 return false
109 }
110 defer zrc.Close()
111 var foundValue bool
112 for {
113 val, err := zrc.Read()
114 if err != nil {
115 return false
116 }
117 if val == nil {
118 return foundValue
119 }
120 foundValue = true
121 }
122}
123
124func runAllBoomerangs(t *testing.T, format string, data map[string]string) {
125 t.Run(format, func(t *testing.T) {

Callers 1

Calls 5

CloseMethod · 0.95
ReadMethod · 0.95
NewReaderFunction · 0.92
NewContextFunction · 0.92
NewReaderMethod · 0.45

Tested by

no test coverage detected