Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Private modules can be fetched with go list #56

Closed
Crocmagnon opened this issue May 14, 2024 · 3 comments · Fixed by #60
Closed

Private modules can be fetched with go list #56

Crocmagnon opened this issue May 14, 2024 · 3 comments · Fixed by #60
Assignees

Comments

@Crocmagnon
Copy link
Contributor

Crocmagnon commented May 14, 2024

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.
@nieomylnieja
Copy link
Owner

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

I'll fix it today. Thanks!

@nieomylnieja nieomylnieja self-assigned this May 18, 2024
@nieomylnieja nieomylnieja linked a pull request May 18, 2024 that will close this issue
@nieomylnieja
Copy link
Owner

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 :)

@Crocmagnon
Copy link
Contributor Author

It does! Thanks 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants