MCPcopy Index your code
hub / github.com/nikivdev/go / set

Method set

workspace.go:198–212  ·  view source on GitHub ↗
(kind workspaceList, values []string)

Source from the content-addressed store, hash-verified

196}
197
198func (w *workspaceDocument) set(kind workspaceList, values []string) error {
199 switch kind {
200 case workspaceListRepoPaths:
201 w.RepoPaths = cloneStrings(values)
202 case workspaceListExpanded:
203 w.WorkingExpandedFolders = cloneStrings(values)
204 case workspaceListSelection:
205 w.WorkingStoredSelection.SelectedPaths = cloneStrings(values)
206 case workspaceListFileBuffer:
207 w.WorkingFilePaths = cloneStrings(values)
208 default:
209 return fmt.Errorf("unknown workspace list %q", kind)
210 }
211 return nil
212}
213
214func cloneStrings(values []string) []string {
215 if len(values) == 0 {

Callers 2

workspaceAddPathFunction · 0.45
workspaceRemovePathFunction · 0.45

Calls 1

cloneStringsFunction · 0.70

Tested by

no test coverage detected