Skip to content

config: a better way to handle uninitialized configs for flag-defaults #4

@yendelevium

Description

@yendelevium

Viper doesn't load the config as the subcommand init functions are called before initializeConfig is called. So during initialization, the Conf variable is empty, and all flag commands which use Conf.{field} as a flag default value will just have their zero-value passed to the flag. I;m handling this by checking if the user didn't change the flag and then manually assigning the default but need to find a better way to do this.

Metadata

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