(s string)
| 30 | } |
| 31 | |
| 32 | func splitMemoryNotesFromString(s string) MemoryNotes { |
| 33 | s = strings.TrimSpace(s) |
| 34 | if s == "" { |
| 35 | return nil |
| 36 | } |
| 37 | lines := strings.Split(s, "\n") |
| 38 | out := make([]string, 0, len(lines)) |
| 39 | for _, line := range lines { |
| 40 | t := strings.TrimSpace(line) |
| 41 | if t != "" { |
| 42 | out = append(out, t) |
| 43 | } |
| 44 | } |
| 45 | if len(out) == 0 { |
| 46 | return nil |
| 47 | } |
| 48 | return MemoryNotes(out) |
| 49 | } |
| 50 | |
| 51 | func normalizeMemoryLines(lines []string) MemoryNotes { |
| 52 | out := make([]string, 0, len(lines)) |
no test coverage detected