MCPcopy Index your code
hub / github.com/ZenNotes/zennotes / appendBrowseShortcut

Function appendBrowseShortcut

apps/server/internal/httpserver/server.go:386–400  ·  view source on GitHub ↗
(shortcuts []directoryBrowseShortcut, label string, path string)

Source from the content-addressed store, hash-verified

384}
385
386func appendBrowseShortcut(shortcuts []directoryBrowseShortcut, label string, path string) []directoryBrowseShortcut {
387 cleaned := strings.TrimSpace(path)
388 if cleaned == "" {
389 return shortcuts
390 }
391 for _, shortcut := range shortcuts {
392 if shortcut.Path == cleaned {
393 return shortcuts
394 }
395 }
396 if info, err := os.Stat(cleaned); err != nil || !info.IsDir() {
397 return shortcuts
398 }
399 return append(shortcuts, directoryBrowseShortcut{Label: label, Path: cleaned})
400}
401
402func browseRootLabel(path string, index int) string {
403 cleaned := filepath.Clean(path)

Callers 1

browseShortcutsMethod · 0.85

Calls 1

appendFunction · 0.85

Tested by

no test coverage detected