MCPcopy
hub / github.com/cli/cli / Flush

Method Flush

pkg/cmd/pr/create/regexp_writer.go:54–64  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

52}
53
54func (s *RegexpWriter) Flush() (int, error) {
55 if len(s.buf) > 0 {
56 repl := []byte(s.repl)
57 filtered := s.re.ReplaceAll(s.buf, repl)
58 if len(filtered) > 0 {
59 return s.out.Write(filtered)
60 }
61 }
62
63 return 0, nil
64}

Callers 2

Test_WriteFunction · 0.95
handlePushFunction · 0.95

Calls 1

WriteMethod · 0.65

Tested by 1

Test_WriteFunction · 0.76