pulsar-client-go icon indicating copy to clipboard operation
pulsar-client-go copied to clipboard

[go]: reduce dependency

Open ttys3 opened this issue 3 years ago • 2 comments

Motivation

currently we have github.com/spf13/cobra v1.2 dependency, which depends on spf13/viper (which is a heavy mod)

the good news is that github.com/spf13/cobra version >= v1.4.0 has viper mod dependency removed.

yes, but we can still avoid introduce unnecessary dependency to SDK client users.

Modifications

make the pulsar-perf binary a standalone mod, so that its cobra dependency does not affect pulsar-client-go

nothing is break, but a more clean go mod

Verifying this change

  • [x] Make sure that the change passes the CI checks.

This change is a trivial rework / code cleanup without any test coverage.

Does this pull request potentially affect one of the following parts:

If yes was chosen, please highlight the changes

  • Dependencies (does it add or upgrade a dependency): (yes)

Dependencies removed from module github.com/apache/pulsar-client-go:

github.com/bmizerany/perks v0.0.0-20141205001514-d9a9656a3a4b

github.com/spf13/cobra v1.2.1

new module github.com/apache/pulsar-client-go/pulsar-perf introduced (which is not a package, but binary only package)

old github.com/spf13/cobra v1.2.1 updated to github.com/spf13/cobra v1.5.0 since this version has github.com/spf13/viper removed (which does not affect the feature of cobra, see https://github.com/spf13/cobra/releases/tag/v1.4.0 )

	github.com/apache/pulsar-client-go v0.8.1
	github.com/bmizerany/perks v0.0.0-20141205001514-d9a9656a3a4b
	github.com/prometheus/client_golang v1.12.2
	github.com/sirupsen/logrus v1.9.0
	github.com/spf13/cobra v1.5.0
  • The public API: (no)
  • The schema: (no)
  • The default values of configurations: (no)
  • The wire protocol: (no)

Documentation

  • Does this pull request introduce a new feature? (no)

ttys3 avatar Jul 29 '22 16:07 ttys3

@zzzming rebased, PTAL

ttys3 avatar Oct 11 '22 02:10 ttys3