parseSync runs the given callback function on each syncT received from the child. It will return once io.EOF is returned from the given pipe.
(pipe *syncSocket, fn func(*syncT) error)
| 187 | // parseSync runs the given callback function on each syncT received from the |
| 188 | // child. It will return once io.EOF is returned from the given pipe. |
| 189 | func parseSync(pipe *syncSocket, fn func(*syncT) error) error { |
| 190 | for { |
| 191 | sync, err := doReadSync(pipe) |
| 192 | if err != nil { |
| 193 | if errors.Is(err, io.EOF) { |
| 194 | break |
| 195 | } |
| 196 | return err |
| 197 | } |
| 198 | if err := fn(&sync); err != nil { |
| 199 | return err |
| 200 | } |
| 201 | } |
| 202 | return nil |
| 203 | } |
no test coverage detected
searching dependent graphs…