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

Method Append

cli/allowlistflag.go:48–60  ·  view source on GitHub ↗
(value string)

Source from the content-addressed store, hash-verified

46}
47
48func (a *AllowListFlag) Append(value string) error {
49 value = strings.TrimSpace(value)
50 if value == "" {
51 return xerrors.New("allow list entry cannot be empty")
52 }
53 var target codersdk.APIAllowListTarget
54 if err := target.UnmarshalText([]byte(value)); err != nil {
55 return err
56 }
57
58 *a = append(*a, target)
59 return nil
60}
61
62func (a *AllowListFlag) Replace(items []string) error {
63 *a = []codersdk.APIAllowListTarget{}

Callers 3

SetMethod · 0.95
ReplaceMethod · 0.95
templateVersionsListMethod · 0.45

Calls 2

UnmarshalTextMethod · 0.95
NewMethod · 0.65

Tested by

no test coverage detected