pipe icon indicating copy to clipboard operation
pipe copied to clipboard

Error read |0: file already closed

Open drummer3333 opened this issue 3 years ago • 0 comments

I have a problem using the pipe.Commands(). When I execute my generator in Gitlab CI 1 out of 5 times io.copy returns an error:

$ go generate ./internal/version/helper.go
2021/10/13 11:16:57 error writing file: error writing file: read |0: file already closed
exit status 1
internal/version/helper.go:9: running "go": exit status 1

so rc must be closed bevor copy is called. but I can't find out why.

I rebuild the pipeline task: https://github.com/drummer3333/pipeerror . Just call run-test.sh and it builds the docker image with an entrypoint similar what gitlab is executing in our CI pipeline (multipe times at once). Our gitlab runner is exectuted by GCP.

I've encoutered the error on my local machine running linux using other generators with similar code, too.

drummer3333 avatar Oct 13 '21 15:10 drummer3333