all: Use new reflect based CLI (#5487)
This commit is contained in:
committed by
Jakob Borg
parent
7bac927ac8
commit
dc929946fe
@@ -12,8 +12,9 @@ type Defaulter struct {
|
||||
Value string
|
||||
}
|
||||
|
||||
func (Defaulter) ParseDefault(v string) (interface{}, error) {
|
||||
return Defaulter{Value: v}, nil
|
||||
func (d *Defaulter) ParseDefault(v string) error {
|
||||
*d = Defaulter{Value: v}
|
||||
return nil
|
||||
}
|
||||
|
||||
func TestSetDefaults(t *testing.T) {
|
||||
@@ -37,9 +38,7 @@ func TestSetDefaults(t *testing.T) {
|
||||
t.Errorf("defaulter failed")
|
||||
}
|
||||
|
||||
if err := SetDefaults(x); err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
SetDefaults(x)
|
||||
|
||||
if x.A != "string" {
|
||||
t.Error("string failed")
|
||||
|
||||
Reference in New Issue
Block a user