MCPcopy
hub / github.com/pquerna/ffjson / Flush

Method Flush

inception/writerstack.go:35–46  ·  view source on GitHub ↗

Flush will return all queued writes, and return "" (empty string) in nothing has been queued "buf.WriteByte('" + byte + "')" + '\n' if one bute has been queued. "buf.WriteString(`" + string + "`)" + "\n" if more than one byte has been queued.

()

Source from the content-addressed store, hash-verified

33// "buf.WriteByte('" + byte + "')" + '\n' if one bute has been queued.
34// "buf.WriteString(`" + string + "`)" + "\n" if more than one byte has been queued.
35func (w *ConditionalWrite) Flush() string {
36 combined := strings.Join(w.Queued, "")
37 if len(combined) == 0 {
38 return ""
39 }
40
41 w.Queued = nil
42 if len(combined) == 1 {
43 return "buf.WriteByte('" + combined + "')" + "\n"
44 }
45 return "buf.WriteString(`" + combined + "`)" + "\n"
46}
47
48func (w *ConditionalWrite) FlushTo(out string) string {
49 out += w.Flush()

Callers 7

FlushToMethod · 0.95
WriteFlushMethod · 0.95
GetQueuedMethod · 0.95
getMapValueFunction · 0.80
getGetInnerValueFunction · 0.80
getFieldFunction · 0.80
CreateMarshalJSONFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected