MCPcopy Create free account
hub / github.com/dkorunic/betteralign / Set

Method Set

betteralign.go:150–159  ·  view source on GitHub ↗

Set splits comma-separated values onto the accumulator, matching the original fieldalignment CLI (`a,b,c` is equivalent to three repeats). Empty entries are dropped to avoid spurious "" matches. Never errors. Not concurrency-safe — run clones the flag slices at start.

(value string)

Source from the content-addressed store, hash-verified

148// are dropped to avoid spurious "" matches. Never errors. Not concurrency-safe
149// — run clones the flag slices at start.
150func (f *StringArrayFlag) Set(value string) error {
151 for v := range strings.SplitSeq(value, ",") {
152 v = strings.TrimSpace(v)
153 if v == "" {
154 continue
155 }
156 *f = append(*f, v)
157 }
158 return nil
159}
160
161var Analyzer = &analysis.Analyzer{
162 Name: "betteralign",

Callers 10

TestApplyFunction · 0.80
TestApplyViaFixAliasFunction · 0.80
TestFlagExcludeDirsFunction · 0.80
TestFlagExcludeFilesFunction · 0.80
TestFlagOptInModeFunction · 0.80
TestFlagTestFilesFunction · 0.80
TestFlagGeneratedFilesFunction · 0.80
mainFunction · 0.80

Calls

no outgoing calls

Tested by 9

TestApplyFunction · 0.64
TestApplyViaFixAliasFunction · 0.64
TestFlagExcludeDirsFunction · 0.64
TestFlagExcludeFilesFunction · 0.64
TestFlagOptInModeFunction · 0.64
TestFlagTestFilesFunction · 0.64
TestFlagGeneratedFilesFunction · 0.64