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

Force replace go_package declaration #114

Merged
merged 2 commits into from
Jun 23, 2022
Merged

Force replace go_package declaration #114

merged 2 commits into from
Jun 23, 2022

Conversation

jekiapp
Copy link
Contributor

@jekiapp jekiapp commented Jun 13, 2022

Motivation

Since we are implementing Go module, Go always look the package declared in go_package on remote resource, even though the generated .pb files is in local. In order to make go mod look for the package in local path, we need to do go mod init for each package. It is very hard to do that since we don't know the root path of each package. Not only that, we need to put a replace statement in go.mod file neighboring server.go. (#105)

Forcing the go_package declaration under gripmock/protogen folder makes it easier for go to locate the intended package, the only thing we do is a single replace statement in go.mod file in gripmock root path.

Another reason for forcing the value update is that non Go user has no reason to put go_package in their proto other than to be used in gripmock. Even if they do, they don't know what is the right value to put in it. (#93, #99)

Changelist

  • Removing declaration of go_package and replace it with our own go_package declaration.
  • Add replace statement in go.mod in order to make go module looking for local resource instead of remote.
  • Change dependency path for all examples

removing declaration of go_package and replace it with our own go_package declaration.
add replace statement in go.mod in order to make go module looking for local resource instead of remote.
@jekiapp jekiapp marked this pull request as ready for review June 13, 2022 08:36
@jekiapp jekiapp force-pushed the support_go_package branch 5 times, most recently from 031ff7a to e88c824 Compare June 15, 2022 07:29
since we are replacing all the go_package then we are using pb generated under protogen for running the tests.
@jekiapp jekiapp merged commit e074e3e into master Jun 23, 2022
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 this pull request may close these issues.

3 participants