diff --git a/cmd/genbindings/clangexec.go b/cmd/genbindings/clangexec.go index e1162d2d..3af41898 100644 --- a/cmd/genbindings/clangexec.go +++ b/cmd/genbindings/clangexec.go @@ -67,13 +67,15 @@ func clangExec(ctx context.Context, clangBin, inputHeader string, cflags []strin inner, innerErr = clangStripUpToFile(pr, matcher) }() + // Go documentation says: only call cmd.Wait once all reads from the + // StdoutPipe have completed + wg.Wait() + err = cmd.Wait() if err != nil { return nil, fmt.Errorf("Command: %w", err) } - wg.Wait() - return inner, innerErr }