Skip to content

Add an interface for flag types that can provide default values#422

Open
peterebden wants to merge 3 commits intojessevdk:mainfrom
peterebden:default-interface
Open

Add an interface for flag types that can provide default values#422
peterebden wants to merge 3 commits intojessevdk:mainfrom
peterebden:default-interface

Conversation

@peterebden
Copy link
Copy Markdown
Contributor

A simple use case might be that you want a flag to have the value of os.UserCacheDir() and don't want to replicate its logic and/or deal with per-platform structs.

I suppose there's a chance that someone already has a type with this method signature which suddenly starts providing defaults. I think the chance is probably low, but there's no real way of avoiding that with Go's implicit interfaces.

Fixes #421

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature Request: Support for function/interface for generating default values

1 participant