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

Method Set

cli/allowlistflag.go:35–46  ·  view source on GitHub ↗
(set string)

Source from the content-addressed store, hash-verified

33func (AllowListFlag) Type() string { return "allow-list" }
34
35func (a *AllowListFlag) Set(set string) error {
36 values, err := csv.NewReader(strings.NewReader(set)).Read()
37 if err != nil {
38 return xerrors.Errorf("parse allow list entries as csv: %w", err)
39 }
40 for _, v := range values {
41 if err := a.Append(v); err != nil {
42 return err
43 }
44 }
45 return nil
46}
47
48func (a *AllowListFlag) Append(value string) error {
49 value = strings.TrimSpace(value)

Callers

nothing calls this directly

Calls 3

AppendMethod · 0.95
ReadMethod · 0.65
ErrorfMethod · 0.45

Tested by

no test coverage detected