MCPcopy Index your code
hub / github.com/coder/envbox / Flush

Method Flush

xio/limitwriter.go:26–34  ·  view source on GitHub ↗

Flush flushes the suffix to the underlying writer.

()

Source from the content-addressed store, hash-verified

24
25// Flush flushes the suffix to the underlying writer.
26func (p *PrefixSuffixWriter) Flush() error {
27 _, err := io.Copy(p.W, bytes.NewReader(p.suffix[p.suffixOff:]))
28 if err != nil {
29 return err
30 }
31
32 _, err = io.Copy(p.W, bytes.NewReader(p.suffix[:p.suffixOff]))
33 return err
34}
35
36func (p *PrefixSuffixWriter) Write(b []byte) (int, error) {
37 lenb := len(b)

Callers 3

startProcessMethod · 0.80
flushMethod · 0.80
TestPrefixSuffixWriterFunction · 0.80

Calls

no outgoing calls

Tested by 1

TestPrefixSuffixWriterFunction · 0.64