-
Notifications
You must be signed in to change notification settings - Fork 38
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
Add mod #58
Add mod #58
Conversation
This adds a go.mod and go.sum file to gax. Unfortunately, gax-go already has a v2.0.0 tag. This means that the module must be a v2 module. So, per [1] we create a v2/ subdirectory, copy all the v1 code there, and mark the go.mod module declaration with /v2. However, there's one more complication: users are directly exposed to exported types in this package such as CallOption. google-cloud-go will rely on v2 of gax, but a user's codebase is still going to have the non-v2/ gax import paths. We could: - Make google-cloud-go rely on v2 and simultaneously create a v2 of google-cloud-go. All existing users of google-cloud-go continue using v1 of gax and v1 of google-cloud-go. All folks migrating to v2 of google-cloud-go must go update their gax import paths to use /v2. (this is obviously infeasible) - Make all gax v1 types aliases of gax v2 types, and all v1 functions shadows of v2 functions. That way, google-cloud-go can rely on v2 but a user can pass either a v1 or v2 gax type. This change will be tagged as v1.0.1 as well as v2.0.1. The versions v1.0.0 and v2.0.0 will be unusable. 1: https://github.com/golang/go/wiki/Modules#releasing-modules-v2-or-higher
@@ -0,0 +1,3 @@ | |||
module github.com/googleapis/gax-go | |||
|
|||
require google.golang.org/grpc v1.16.0 |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This commit was generated by copying the contents of the parent directory into the v2 directory. This commit supercedes googleapis#58 and is one of two in a series of commits to add Go module support to gax. Unfortunately, gax-go already has a v2.0.0 tag. So, per [1] we create a v2/ subdirectory, copy all the v1 code, and create a v2 go.mod in the subdirectory. Then, after this commit is merged, the commit will be tagged v2.0.1. This is a combination of the "Major Branch" and the "Major Subdirectory" approaches mentioned in [1]. 1: https://github.com/golang/go/wiki/Modules#releasing-modules-v2-or-higher
This commit was generated by copying the contents of the parent directory into the v2 directory. This commit supercedes googleapis#58 and is one of two in a series of commits to add Go module support to gax. Unfortunately, gax-go already has a v2.0.0 tag. So, per [1] we create a v2/ subdirectory, copy all the v1 code, and create a v2 go.mod in the subdirectory. Then, after this commit is merged, the commit will be tagged v2.0.1. This is a combination of the "Major Branch" and the "Major Subdirectory" approaches mentioned in [1]. 1: https://github.com/golang/go/wiki/Modules#releasing-modules-v2-or-higher
Unfortunately it turns out we can't do this atomically. In order for v1 to depend on v2, v2 has to already have been committed, pushed, and tagged. Only then will I'm breaking this PR into two PRs:
The first of which is here: #59. |
Oh..that makes so much sense 😆 |
add v2 directory This commit was generated by copying the contents of the parent directory into the v2 directory. This commit supercedes #58 and is one of two in a series of commits to add Go module support to gax. Unfortunately, gax-go already has a v2.0.0 tag. So, per [1] we create a v2/ subdirectory, copy all the v1 code, and create a v2 go.mod in the subdirectory. Then, after this commit is merged, the commit will be tagged v2.0.1. This is a combination of the "Major Branch" and the "Major Subdirectory" approaches mentioned in [1]. 1: https://github.com/golang/go/wiki/Modules#releasing-modules-v2-or-higher
This commit supercedes googleapis#58 and follows googleapis#59, and is the second of two in a series of commits to add Go module support to gax. This commit makes v1 code type aliases of v2 code. This commit will be tagged v1.0.1. Reasoning for making type aliases: Users are directly exposed to exported types in this package such as CallOption. google-cloud-go will rely on v2 of gax, but a user's codebase is still going to have the non-v2/ gax import paths. We could: - Make google-cloud-go rely on v2 and simultaneously create a v2 of google-cloud-go. All existing users of google-cloud-go continue using v1 of gax and v1 of google-cloud-go. All folks migrating to v2 of google-cloud-go must go update their gax import paths to use /v2. (this is obviously infeasible) - Make all gax v1 types aliases of gax v2 types, and all v1 functions shadows of v2 functions. That way, google-cloud-go can rely on v2 but a user can pass either a v1 or v2 gax type.
* make v1 a type alias of v2 This commit supercedes #58 and follows #59, and is the second of two in a series of commits to add Go module support to gax. This commit makes v1 code type aliases of v2 code. This commit will be tagged v1.0.1. Reasoning for making type aliases: Users are directly exposed to exported types in this package such as CallOption. google-cloud-go will rely on v2 of gax, but a user's codebase is still going to have the non-v2/ gax import paths. We could: - Make google-cloud-go rely on v2 and simultaneously create a v2 of google-cloud-go. All existing users of google-cloud-go continue using v1 of gax and v1 of google-cloud-go. All folks migrating to v2 of google-cloud-go must go update their gax import paths to use /v2. (this is obviously infeasible) - Make all gax v1 types aliases of gax v2 types, and all v1 functions shadows of v2 functions. That way, google-cloud-go can rely on v2 but a user can pass either a v1 or v2 gax type. * add missing newline * Add go.mod
I'm still vetting this change, but I thought I'd send it out now to start getting early feedback. I figure it's better to know sooner than later if this seems like a very wrong road to go down. :)
Note that this change has a reliance on google-cloud-go for the same reason as is discussed here.
Commit message: