Skip to content

Cobra pull a lot of dependencies through viper #1138

Closed
@MichaelMure

Description

When using Cobra in a project, a lot of dependencies are added that are not actually useful for that project. Those comes through viper, which is used in cobra/cmd, that is a CLI tool only useful occasionally for the developer.

github.com/spf13/[email protected] github.com/armon/[email protected]
github.com/spf13/[email protected] github.com/coreos/[email protected]
github.com/spf13/[email protected] github.com/coreos/[email protected]+incompatible
github.com/spf13/[email protected] github.com/coreos/[email protected]
github.com/spf13/[email protected] github.com/coreos/[email protected]
github.com/spf13/[email protected] github.com/coreos/[email protected]
github.com/spf13/[email protected] github.com/dgrijalva/[email protected]+incompatible
github.com/spf13/[email protected] github.com/fsnotify/[email protected]
github.com/spf13/[email protected] github.com/gogo/[email protected]
github.com/spf13/[email protected] github.com/golang/[email protected]
github.com/spf13/[email protected] github.com/google/[email protected]
github.com/spf13/[email protected] github.com/gorilla/[email protected]
github.com/spf13/[email protected] github.com/grpc-ecosystem/[email protected]
github.com/spf13/[email protected] github.com/grpc-ecosystem/[email protected]
github.com/spf13/[email protected] github.com/grpc-ecosystem/[email protected]
github.com/spf13/[email protected] github.com/hashicorp/[email protected]
github.com/spf13/[email protected] github.com/jonboulle/[email protected]
github.com/spf13/[email protected] github.com/magiconair/[email protected]
github.com/spf13/[email protected] github.com/mitchellh/[email protected]
github.com/spf13/[email protected] github.com/pelletier/[email protected]
github.com/spf13/[email protected] github.com/prometheus/[email protected]
github.com/spf13/[email protected] github.com/soheilhy/[email protected]
github.com/spf13/[email protected] github.com/spf13/[email protected]
github.com/spf13/[email protected] github.com/spf13/[email protected]
github.com/spf13/[email protected] github.com/spf13/[email protected]
github.com/spf13/[email protected] github.com/spf13/[email protected]
github.com/spf13/[email protected] github.com/stretchr/[email protected]
github.com/spf13/[email protected] github.com/tmc/[email protected]
github.com/spf13/[email protected] github.com/ugorji/[email protected]
github.com/spf13/[email protected] github.com/xiang90/[email protected]
github.com/spf13/[email protected] github.com/xordataexchange/[email protected]
github.com/spf13/[email protected] go.etcd.io/[email protected]
github.com/spf13/[email protected] go.uber.org/[email protected]
github.com/spf13/[email protected] go.uber.org/[email protected]
github.com/spf13/[email protected] go.uber.org/[email protected]
github.com/spf13/[email protected] golang.org/x/[email protected]
github.com/spf13/[email protected] golang.org/x/[email protected]
github.com/spf13/[email protected] google.golang.org/[email protected]
github.com/spf13/[email protected] gopkg.in/[email protected]

Those are quite heavy dependencies: Etcd, systemd, protobuf, prometheus, websocket, GRPC ...

Could you add a secondary go.mod file in the /cobra folder ? This would segregate those deps into the CLI tool and avoid having all that in a project using Cobra without Viper.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions