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

protoc-gen-go: fix up generation of package names #576

Merged
merged 1 commit into from
Apr 2, 2018

Conversation

neild
Copy link
Contributor

@neild neild commented Mar 30, 2018

An earlier change inadvertendly made the import_path flag stop setting
the package name. In addition, we intentionally removed the behavior where
a go_package option in one file would set the package name for other
generated files, in anticipation of allowing a single compilation action
to generate code for many packages.

This change restores the import_path behavior. It also permits a go_package
option in one file to affect other files in the same package. (Every
source file should include a go_package option, which makes this case moot,
but this minimizes the amount of breaking change that we're introducing.)

Also tweak assignment of import paths to allow the import_path flag to
set the import path for all generated files.

@neild neild requested a review from dsnet March 30, 2018 03:49
An earlier change inadvertendly made the import_path flag stop setting
the package name. In addition, we intentionally removed the behavior where
a go_package option in one file would set the package name for other
generated files, in anticipation of allowing a single compilation action
to generate code for many packages.

This change restores the import_path behavior. It also permits a go_package
option in one file to affect other files *in the same package*. (Every
source file should include a go_package option, which makes this case moot,
but this minimizes the amount of breaking change that we're introducing.)

Also tweak assignment of import paths to allow the import_path flag to
set the import path for all generated files.
Copy link
Member

@dsnet dsnet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It also permits a go_package option in one file to affect other files in the same package.

👻 Spooky behavior at a distance. 👻

@neild neild merged commit 3b4abe1 into golang:dev Apr 2, 2018
@golang golang locked and limited conversation to collaborators Jun 26, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants