(lines []string)
| 1149 | } |
| 1150 | |
| 1151 | func loadSSHManagedBlock(lines []string) (sshManagedBlock, bool) { |
| 1152 | for index, line := range lines { |
| 1153 | if strings.TrimSpace(line) != sshManagedMarker { |
| 1154 | continue |
| 1155 | } |
| 1156 | end := len(lines) |
| 1157 | for next := index + 1; next < len(lines); next++ { |
| 1158 | if strings.HasPrefix(strings.ToLower(strings.TrimSpace(lines[next])), "match ") { |
| 1159 | end = next |
| 1160 | break |
| 1161 | } |
| 1162 | } |
| 1163 | return sshManagedBlock{Start: index + 1, End: end}, true |
| 1164 | } |
| 1165 | return sshManagedBlock{}, false |
| 1166 | } |
| 1167 | |
| 1168 | func loadSSHManagedBlockFromFile(fileName string) (sshManagedBlock, error) { |
| 1169 | content, err := os.ReadFile(fileName) |
no outgoing calls
no test coverage detected