MCPcopy Create free account
hub / github.com/diillson/chatcli / splitProfileKV

Function splitProfileKV

cli/memory_command.go:339–350  ·  view source on GitHub ↗

splitProfileKV splits "key=value" or "key: value" into its parts.

(s string)

Source from the content-addressed store, hash-verified

337
338// splitProfileKV splits "key=value" or "key: value" into its parts.
339func splitProfileKV(s string) (key, value string, ok bool) {
340 for _, sep := range []string{"=", ":"} {
341 if idx := strings.Index(s, sep); idx > 0 {
342 key = strings.TrimSpace(s[:idx])
343 value = strings.TrimSpace(s[idx+len(sep):])
344 if key != "" && value != "" {
345 return key, value, true
346 }
347 }
348 }
349 return "", "", false
350}
351
352func (cli *ChatCLI) showMemoryTopics() {
353 mgr := cli.memoryStore.Manager()

Callers 2

TestSplitProfileKVFunction · 0.85
setMemoryProfileMethod · 0.85

Calls

no outgoing calls

Tested by 1

TestSplitProfileKVFunction · 0.68