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

why does 'cobra init' require --pkg-name when go.mod is present? #891

Closed
josharian opened this issue Jun 19, 2019 · 6 comments
Closed

why does 'cobra init' require --pkg-name when go.mod is present? #891

josharian opened this issue Jun 19, 2019 · 6 comments

Comments

@josharian
Copy link

The first line of go.mod contains the fully qualified import path of the module. Could cobra init just use it?

@jharshman
Copy link
Collaborator

That assumes a go.mod file is present which is not required for init in a new directory.

@josharian
Copy link
Author

Right. But when it is present (as it was in my case), cobra could use it.

@jharshman
Copy link
Collaborator

I don't see any immediate problem with that functionality. If you want to open up a PR with your suggested changes, tag me and I'll take a look.

@josharian
Copy link
Author

Hmmm. Blocked on golang/go#31761, in particular, the addition of golang.org/x/mod/modfile.

@jharshman
Copy link
Collaborator

@josharian if this is blocked and has no immediate resolution I think it's appropriate to close this issue.

@josharian
Copy link
Author

As you wish.

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

No branches or pull requests

2 participants