MCPcopy Index your code
hub / github.com/cloudquery/cloudquery / Set

Method Set

cli/internal/enum/enum.go:27–41  ·  view source on GitHub ↗
(p string)

Source from the content-addressed store, hash-verified

25}
26
27func (a *Enum) Set(p string) error {
28 isIncluded := func(opts []string, val string) bool {
29 for _, opt := range opts {
30 if val == opt {
31 return true
32 }
33 }
34 return false
35 }
36 if !isIncluded(a.Allowed, p) {
37 return fmt.Errorf("%s is not included in %s", p, strings.Join(a.Allowed, ","))
38 }
39 a.Value = p
40 return nil
41}
42
43func (*Enum) Type() string {
44 return "string"

Callers 1

NewCmdRootFunction · 0.95

Calls 1

ErrorfMethod · 0.80

Tested by

no test coverage detected