You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
The wrapper around go list treats stderr as fatal and exits if there's nonzero output here. This breaks when children processes of go list output things like download logs, which are commonly emitted to stderr as an (informal?) standard (true fatals being just exits, with status code = 1, see examples here).
We should probably not read from stderr since it's not guaranteed every dependency of go list assumes stderr to actually only output fatals. Would be cool if that entire final error handling block was removed.
To Reproduce
Steps to reproduce the behavior:
Have non-trivial dependencies when running swag with go list
Log what's actually in stderr
See that it's just expected downloads; eg for a clean install in docker
Exits 1 after running swag init
Expected behavior
No exiting even if stderr is non-empty
Screenshots
N/A, but basically I added a custom line in the first linked source to prepend and append some custom text, since the output was confusing me:
defer func() {
if stderrBuf.Len() > 0 {
finalErr = fmt.Errorf("START OF STDERR: \n\n\n %v\n%s END OF STDERR \n\n\n", finalErr, stderrBuf.Bytes())
}
}()
And it would just output a bunch of expected downloads, since my build step runs in CI with a clean docker installation (+ no go dependencies installed by default):
START OF STDERR:
go: downloading github.com/hashicorp/go-secure-stdlib/mlock v0.1.1
go: downloading github.com/hashicorp/go-uuid v1.0.2
go: downloading github.com/hashicorp/golang-lru v0.5.4
go: downloading github.com/hashicorp/go-version v1.2.0
go: downloading github.com/armon/go-radix v1.0.0
... more stuff
END OF STDERR
Your swag version
e.g. 1.8.6
Your go version
e.g. 1.18.0
Desktop (please complete the following information):
Describe the bug
The wrapper around
go list
treats stderr as fatal and exits if there's nonzero output here. This breaks when children processes of go list output things like download logs, which are commonly emitted to stderr as an (informal?) standard (true fatals being justexits, with status code = 1
, see examples here).We should probably not read from stderr since it's not guaranteed every dependency of
go list
assumes stderr to actually only output fatals. Would be cool if that entire final error handling block was removed.To Reproduce
Steps to reproduce the behavior:
swag
withgo list
swag init
Expected behavior
No exiting even if
stderr
is non-emptyScreenshots
N/A, but basically I added a custom line in the first linked source to prepend and append some custom text, since the output was confusing me:
And it would just output a bunch of expected downloads, since my build step runs in CI with a clean docker installation (+ no go dependencies installed by default):
Your swag version
e.g. 1.8.6
Your go version
e.g. 1.18.0
Desktop (please complete the following information):
Additional context
Maybe related? #1232
The text was updated successfully, but these errors were encountered: