MCPcopy
hub / github.com/larksuite/cli / SplitCSV

Function SplitCSV

shortcuts/common/common.go:138–151  ·  view source on GitHub ↗

SplitCSV 解析逗号分隔的列表,忽略空项并去除空格

(input string)

Source from the content-addressed store, hash-verified

136
137// SplitCSV 解析逗号分隔的列表,忽略空项并去除空格
138func SplitCSV(input string) []string {
139 if input == "" {
140 return nil
141 }
142 parts := strings.Split(input, ",")
143 var result []string
144 for _, p := range parts {
145 p = strings.TrimSpace(p)
146 if p != "" {
147 result = append(result, p)
148 }
149 }
150 return result
151}
152
153// CheckApiError checks if API result is an error and prints it to w.
154func CheckApiError(w io.Writer, result interface{}, action string) bool {

Callers 15

buildSearchBodyFunction · 0.92
vc_recording.goFile · 0.92
vc_detail.goFile · 0.92
vc_notes.goFile · 0.92
buildSearchEventFilterFunction · 0.92
parseAndDedupQueriesFunction · 0.92
validateSearchUserFunction · 0.92
buildSearchUserBodyFunction · 0.92
buildMinutesSearchFilterFunction · 0.92
minutes_search.goFile · 0.92
minutes_detail.goFile · 0.92

Calls

no outgoing calls

Tested by 4

TestSplitCSVFunction · 0.74
TestSplitAndTrimFunction · 0.74
TestSplitMembersFunction · 0.74
TestSplitAndTrimChatFunction · 0.74