gojp / goreportcard

A report card for your Go application
https://goreportcard.com
Apache License 2.0
1.99k stars 252 forks source link

Could not analyze the repository: [...]: malformed module path: missing dot in first path element #426

Open ndewet opened 2 months ago

ndewet commented 2 months ago

I've attempted to add the Go Report Card to my project https://github.com/ndewet/microx, but I have encountered the following error:

There was an error processing your request: Could not analyze the repository: could not download repo: could not get latest module version from https://proxy.golang.org/microx/@latest: bad request: invalid escaped module path "microx": malformed module path "microx": missing dot in first path element

When visiting https://goreportcard.com/report/github.com/ndewet/microx.

I've followed the URL mentioned in the error: https://proxy.golang.org/microx/@latest, which does indeed produce a bad request response.

While I may be mistaken, I believe that the following url is correct: https://proxy.golang.org/github.com/ndewet/microx/@latest

lordofscripts commented 2 months ago

I too was thinking of adding the Report Card to my README but I got the same error generated on my project:

https://github.com/lordofscripts/govee and there is nothing wrong with my project URL. The project compiles without errors too but the report card generation fails.

JasonLovesDoggo commented 1 month ago

I got the same issue. It turns out that proxy.golang.org expects lowercase, should be an easy fix.

https://proxy.golang.org/github.com/JasonLovesDoggo/Katib/@latest fails, yet https://proxy.golang.org/github.com/jasonlovesdoggo/katib/@latest works just fine

lordofscripts commented 1 month ago

In my case the solution turned out to be something else. My package was local, published on Github but still I had not github.com/ as prefix. So, in my imports I changed the path from the local version to public version:

"lordofscripts/govee" changed to "github.com/lordofscripts/govee"

And that was it, it was crapping out with "malformed" error because the import path was missing a URL part. After I corrected that the Go Report Card started working. I did notice there is a considerable delay though. After pushing to GitHub invoking the report would still show old data. Apparently it needs some time to propagate.

lordofscripts commented 2 weeks ago

Facing same issue with another package. This report card seems to depend on the position of the planets.