nieomylnieja/go-libyear

Private modules can be fetched with go list

Closed this issue ยท 3 comments

What happens

$ go-libyear --go-list ./go.mod
Error: private module path: 'example.com/module' cannot be handled by any supported VCS [git]

where example.com/module is an internal module, on a domain configured in GOPRIVATE.

Expected behavior

When commenting this block:

go-libyear/command.go

Lines 108 to 115 in 5dc2dd4

// Verify if the module is private.
if c.vcs.IsPrivate(module.Path) {
var err error
repo, err = c.vcs.GetHandler(module.Path)
if err != nil {
return err
}
}

I'm getting the behavior I'd expect:

$ go-libyear --go-list ./go.mod
# ... (prints proper report)

Notes

  • It looks like go-libyear tries to detect whether it can fetch the repo with git without even checking if it's running with go-list.
  • I don't know whether all private repos can be accessed with go list.

Yeah, this is a clear oversight on my part and a correct identification of the the issue :)

I'll fix it today. Thanks!

The issue should be fixed in https://github.com/nieomylnieja/go-libyear/releases/tag/v0.4.2.

Let me know if it works for you now :)

It does! Thanks ๐Ÿ™‚