-
Notifications
You must be signed in to change notification settings - Fork 368
[go]: reduce dependency #819
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
base: master
Are you sure you want to change the base?
Conversation
zzzming
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR is helpful to remove unnecessary dependency if we upgrade spf13/cobra.
LGTM.
@ttys3 can you rebase the PR?
32c4375 to
faad803
Compare
|
@zzzming rebased, PTAL |
pgier
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 to upgrading the cobra dependency
However, I'm not sure if it's a good idea to split pulsar-perf-go to a separate module. In general it's recommended to have a single go module per git repo. Although I understand the advantage in this case because users of the client library should normally never depend on the specific pulsar-perf code.
It might be better to have two separate PRs, one for the cobra upgrade, and a separate one for the pulsar-perf split.
now that main branch has https://github.com/apache/pulsar-client-go/blob/be553141c52d5088981452ea5444aa62135b52d3/go.mod#L22C2-L22C31 so no need update cobra anymore. I you are OK to merge, I can continue to work on the pulsar-perf split |
Motivation
currently we have
github.com/spf13/cobra v1.2dependency, which depends onspf13/viper(which is a heavy mod)the good news is that github.com/spf13/cobra version >= v1.4.0 has
vipermod dependency removed.yes, but we can still avoid introduce unnecessary dependency to SDK client users.
Modifications
make the
pulsar-perfbinary a standalone mod, so that itscobradependency does not affect pulsar-client-gonothing is break, but a more clean go mod
Verifying this change
This change is a trivial rework / code cleanup without any test coverage.
Does this pull request potentially affect one of the following parts:
If
yeswas chosen, please highlight the changesDependencies removed from module
github.com/apache/pulsar-client-go:new module
github.com/apache/pulsar-client-go/pulsar-perfintroduced (which is not a package, but binary only package)old
github.com/spf13/cobra v1.2.1updated togithub.com/spf13/cobra v1.5.0since this version hasgithub.com/spf13/viperremoved (which does not affect the feature of cobra, see https://github.com/spf13/cobra/releases/tag/v1.4.0 )Documentation