lichen icon indicating copy to clipboard operation
lichen copied to clipboard

go mod download output cannot be parsed when using private repos

Open strowk opened this issue 4 months ago • 0 comments

The case is same as in #9 , however I do have GOPRIVATE set correctly and I have different error:

failed to evaluate licenses: invalid character 'g' looking for beginning of value

I tracked it down (mostly logically) to this place:

https://github.com/uw-labs/lichen/blob/46b79dff606d9c4931e5435c2c85b71d0ea353ef/internal/module/fetch.go#L48-L50

, as this seems to be the only place where JSON is parsed and error seems to be from json parsing (somewhere about here: https://github.com/golang/go/blob/07ee3bfc631cd6593c10b8715fc58b05d844f4ba/src/encoding/json/scanner.go#L251 ).

Now I understand that somehow I have screwed up the access (probably), though all other tools (like f.e golang ci lint) work fine and I cannot easily determine why go mod download has an issue (I thought it might be because GOPRIVATE env was lost, but I am pretty sure it shouldn't). The problem I see in lichen specifically is that it does not print in the output an original text that it was trying to parse and failed. Is it possible to add such output in that error case, so it can be easier to diagnose what went wrong?

strowk avatar Aug 19 '25 15:08 strowk