summaryrefslogtreecommitdiff
path: root/vendor/github.com/spf13/viper/flags.go
diff options
context:
space:
mode:
authorLibravatar Terin Stock <terinjokes@gmail.com>2025-03-09 17:47:56 +0100
committerLibravatar Terin Stock <terinjokes@gmail.com>2025-12-01 22:08:04 +0100
commitb1af8fd87760b34e3ff2fd3bda38f211815a0473 (patch)
tree9317fad1a7ec298d7a8d2678e4e422953bbc6f33 /vendor/github.com/spf13/viper/flags.go
parent[chore] update URLs to forked source (diff)
downloadgotosocial-b1af8fd87760b34e3ff2fd3bda38f211815a0473.tar.xz
[chore] remove vendor
Diffstat (limited to 'vendor/github.com/spf13/viper/flags.go')
-rw-r--r--vendor/github.com/spf13/viper/flags.go57
1 files changed, 0 insertions, 57 deletions
diff --git a/vendor/github.com/spf13/viper/flags.go b/vendor/github.com/spf13/viper/flags.go
deleted file mode 100644
index de033ed58..000000000
--- a/vendor/github.com/spf13/viper/flags.go
+++ /dev/null
@@ -1,57 +0,0 @@
-package viper
-
-import "github.com/spf13/pflag"
-
-// FlagValueSet is an interface that users can implement
-// to bind a set of flags to viper.
-type FlagValueSet interface {
- VisitAll(fn func(FlagValue))
-}
-
-// FlagValue is an interface that users can implement
-// to bind different flags to viper.
-type FlagValue interface {
- HasChanged() bool
- Name() string
- ValueString() string
- ValueType() string
-}
-
-// pflagValueSet is a wrapper around *pflag.ValueSet
-// that implements FlagValueSet.
-type pflagValueSet struct {
- flags *pflag.FlagSet
-}
-
-// VisitAll iterates over all *pflag.Flag inside the *pflag.FlagSet.
-func (p pflagValueSet) VisitAll(fn func(flag FlagValue)) {
- p.flags.VisitAll(func(flag *pflag.Flag) {
- fn(pflagValue{flag})
- })
-}
-
-// pflagValue is a wrapper around *pflag.flag
-// that implements FlagValue.
-type pflagValue struct {
- flag *pflag.Flag
-}
-
-// HasChanged returns whether the flag has changes or not.
-func (p pflagValue) HasChanged() bool {
- return p.flag.Changed
-}
-
-// Name returns the name of the flag.
-func (p pflagValue) Name() string {
- return p.flag.Name
-}
-
-// ValueString returns the value of the flag as a string.
-func (p pflagValue) ValueString() string {
- return p.flag.Value.String()
-}
-
-// ValueType returns the type of the flag as a string.
-func (p pflagValue) ValueType() string {
- return p.flag.Value.Type()
-}