Skip to content

Commit 6d2079d

Browse files
committed
Formatting
1 parent 5c571dd commit 6d2079d

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

cli/clibase/values.go

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,14 @@ import (
1616
"gopkg.in/yaml.v3"
1717
)
1818

19+
// NoOptDefValuer describes behavior when no
20+
// option is passed into the flag.
21+
//
22+
// This is useful for boolean or otherwise binary flags.
23+
type NoOptDefValuer interface {
24+
NoOptDefValue() string
25+
}
26+
1927
// Validator is a wrapper around a pflag.Value that allows for validation
2028
// of the value after or before it has been set.
2129
type Validator[T pflag.Value] struct {
@@ -59,14 +67,6 @@ func (i *Validator[T]) Type() string {
5967
return i.Value.Type()
6068
}
6169

62-
// NoOptDefValuer describes behavior when no
63-
// option is passed into the flag.
64-
//
65-
// This is useful for boolean or otherwise binary flags.
66-
type NoOptDefValuer interface {
67-
NoOptDefValue() string
68-
}
69-
7070
// values.go contains a standard set of value types that can be used as
7171
// Option Values.
7272

@@ -372,10 +372,12 @@ type Struct[T any] struct {
372372
Value T
373373
}
374374

375+
//nolint:revive
375376
func (s *Struct[T]) Set(v string) error {
376377
return yaml.Unmarshal([]byte(v), &s.Value)
377378
}
378379

380+
//nolint:revive
379381
func (s *Struct[T]) String() string {
380382
byt, err := yaml.Marshal(s.Value)
381383
if err != nil {
@@ -404,6 +406,7 @@ func (s *Struct[T]) UnmarshalYAML(n *yaml.Node) error {
404406
return n.Decode(&s.Value)
405407
}
406408

409+
//nolint:revive
407410
func (s *Struct[T]) Type() string {
408411
return fmt.Sprintf("struct[%T]", s.Value)
409412
}

0 commit comments

Comments
 (0)