sonatype-nexus-community / nancy

A tool to check for vulnerabilities in your Golang dependencies, powered by Sonatype OSS Index
Apache License 2.0
549 stars 76 forks source link

Nancy produces invalid JSON again and again [bug] #245

Closed AndreyMZ closed 2 years ago

AndreyMZ commented 2 years ago

Steps to reproduce

go list -json -m all | docker run --rm -i sonatypecommunity/nancy:v1.0.22 sleuth --output=json > nancy-result.json
python -m json.tool < nancy-result.json
head -n2 nancy-result.json

Actual result

C:\project>go list -json -m all | docker run --rm -i sonatypecommunity/nancy:v1.0.22 sleuth --output=json > nancy-result.json

C:\project>python -m json.tool < nancy-result.json
Expecting value: line 1 column 1 (char 0)

C:\project>head -n2 nancy-result.json
Checking for updates...
Already up-to-date.

Expected result

No errors on parsing JSON.

Additional information

This is not a first issue about invalid JSON output. The previous ones are #90 and #143. I think it's worth adding an autotest.

cc @bhamail / @DarthHater

DarthHater commented 2 years ago

I'll try and take a gander at this today!