nolint:unused // used by memory_worker_test via parseMemoryResponse.
(upperResponse string, keyword string)
| 541 | |
| 542 | //nolint:unused // used by memory_worker_test via parseMemoryResponse. |
| 543 | func 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 | } |
no outgoing calls
no test coverage detected