-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
protoc-gen-go: remove generation of magic import comment #678
Comments
Or at least make it configurable somehow |
Usage of the import comment is being deprecated in favor of a go.mod file as the Go ecosystem moves towards modules. Fixes #678
Usage of the import comment is being deprecated in favor of a go.mod file as the Go ecosystem moves towards modules. Fixes #678
Usage of the import comment is being deprecated in favor of a go.mod file as the Go ecosystem moves towards modules. Fixes #678
Usage of the import comment is being deprecated in favor of a go.mod file as the Go ecosystem moves towards modules. Fixes #678
This move seems premature. While the package import comments might be deprecated, they will still be effective (and not harmful!) for likely quite some time. I'd wait at least a year on this. |
Are they particularly important to generate? We only started adding them relatively recently, and anyone who does want an import comment can include a handwritten stub |
They're useful in the ways that import comments in non-generated packages are useful: they ensure a package is only imported in a specific way (and this is doubly important for proto packages to avoid duplicate registrations!). I could write a stub Note that they existed for a long time internal to Google. I can't remember why it wasn't generated externally for so long. But my point still stands: they're useful (that's why you added them earlier this year!), and will remain useful for quite some time. Modules aren't going to be widely adopted in the short term; it'll take some time. |
I don't think the import comments ever existed internal to Google, did they? We build everything with Blaze, so |
Maybe I'm misremembering, or don't have the old emails any more. |
Anyway, I don't feel particularly strongly. I think they'd be useful to keep around for the next 6-12mo, and I don't see any harm in them, but it's your call. |
As I remember it, internally at Google the The notion of having it as a full import path just kind of weirds me out, as it locks/locked you into building out of the GOPATH, which I was never a fan of. |
Having the full import path in Internally to Google, we do pass everything on the command-line because the build system (Blaze) knows the import paths and can easily construct complex But for users who just want to run And once we know the import path, it seems reasonable to put it in a Anyway, I don't feel strongly about this either way. On one hand the import comment seems harmless to me; on the other hand it's trivial to drop in a stub |
POLL: Should we keep generating the Thumbs up for yes, thumbs down for no, heart for throw it all out and go back to XML. :) |
I know the purpose of specifying the full import, but like I said, it locked you into doing everything in the GOPATH. I was also mostly just looking to add more Google input. Of course also in Google the |
Removal made in #701 from #678 (comment) it seems that the general opinion is to remove them. |
This is a reversion of #267.
The Go tooling ecosystem in moving towards modules, where this import comment is being deprecated in favor of a
go.mod
file. The magic// import "path/to/package"
comment may be used to initialize ago.mod
file, but the use ofgo.mod
supersedes the magic comment afterwards.We may remove this now, or wait until module support is even more solidified.
The text was updated successfully, but these errors were encountered: