Skip to content

Viper flags should use constants for flag values #81

@ninjamast3r

Description

@ninjamast3r

To avoid getting flags out of sync if we ever change them, the viper names should use constants. So instead of:

cmd.Flags().String("foo", "", "it does stuff")
...
foo := viper.GetString("foo")

do this:

const fooFlag := "foo"
cmd.Flags().String(fooFlag , "", "it does stuff")
...
foo := viper.GetString(fooFlag )

Keep the flags related to whatever commands they reference. No need to reference variables from way across the project.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions