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

Function findSectionIndex

cli/memory_worker.go:543–558  ·  view source on GitHub ↗

nolint:unused // used by memory_worker_test via parseMemoryResponse.

(upperResponse string, keyword string)

Source from the content-addressed store, hash-verified

541
542//nolint:unused // used by memory_worker_test via parseMemoryResponse.
543func findSectionIndex(upperResponse string, keyword string) int {
544 patterns := []string{
545 "## " + keyword,
546 "##" + keyword,
547 "# " + keyword,
548 "**" + keyword + "**",
549 }
550 best := -1
551 for _, p := range patterns {
552 idx := strings.Index(upperResponse, p)
553 if idx >= 0 && (best < 0 || idx < best) {
554 best = idx
555 }
556 }
557 return best
558}

Callers 1

parseMemoryResponseFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected