Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions options/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,25 @@
})
}

case *registry.ConfigOption[T, *string]:

Check failure on line 82 in options/options.go

View workflow job for this annotation

GitHub Actions / Verify Docgen

*string does not satisfy registry.Option (*string missing in int | string | []string | bool | time.Duration)

Check failure on line 82 in options/options.go

View workflow job for this annotation

GitHub Actions / Analyze (go)

*string does not satisfy registry.Option (*string missing in int | string | []string | bool | time.Duration)

Check failure on line 82 in options/options.go

View workflow job for this annotation

GitHub Actions / unit-test / witness

*string does not satisfy registry.Option (*string missing in int | string | []string | bool | time.Duration)

Check failure on line 82 in options/options.go

View workflow job for this annotation

GitHub Actions / sast / witness

*string does not satisfy registry.Option (*string missing in int | string | []string | bool | time.Duration)

Check failure on line 82 in options/options.go

View workflow job for this annotation

GitHub Actions / e2e-test / witness

*string does not satisfy registry.Option (*string missing in int | string | []string | bool | time.Duration)
{
defaultVal := optT.DefaultVal()
if defaultVal == nil {
emptyString := ""
defaultVal = &emptyString
}

val := cmd.Flags().String(name, *defaultVal, opt.Description())
optSettersMap[regName] = append(optSettersMap[regName], func(a T) (T, error) {
// if the user hasn't supplied the flag, don't call the setter
if !cmd.Flags().Changed(name) {
return a, nil
}

return optT.Setter()(a, val)
})
}

default:
log.Debugf("unrecognized attestor option type: %T", optT)
}
Expand Down
Loading