MCPcopy Create free account
hub / github.com/PostHog/duckgres / drainToEOF

Function drainToEOF

server/flightclient/exec_update_trailer.go:85–96  ·  view source on GitHub ↗

drainToEOF reads from the stream until io.EOF or another non-nil error. Per the gRPC contract, the trailer is only reachable after Recv returns a non-nil error — io.EOF is the expected terminator for a clean DoPut/ExecuteUpdate exchange.

(stream pb.FlightService_DoPutClient)

Source from the content-addressed store, hash-verified

83// a non-nil error — io.EOF is the expected terminator for a clean
84// DoPut/ExecuteUpdate exchange.
85func drainToEOF(stream pb.FlightService_DoPutClient) error {
86 for {
87 _, err := stream.Recv()
88 if err == nil {
89 continue
90 }
91 if errors.Is(err, io.EOF) {
92 return nil
93 }
94 return err
95 }
96}

Callers 1

executeUpdateWithTrailerFunction · 0.85

Calls 1

RecvMethod · 0.45

Tested by

no test coverage detected