(cwd string, cfg config.Config)
| 354 | } |
| 355 | return ProjectDoc{}, errors.New("project instruction file not found") |
| 356 | } |
| 357 | |
| 358 | func readFileWithByteLimit(path string, maxBytes int) ([]byte, bool, error) { |
| 359 | content, err := os.ReadFile(path) |
| 360 | if err != nil { |
| 361 | return nil, false, err |
| 362 | } |
| 363 | if maxBytes <= 0 || len(content) <= maxBytes { |
| 364 | return content, false, nil |
| 365 | } |
| 366 | return content[:maxBytes], true, nil |
| 367 | } |
| 368 | |
| 369 | func LoadProjectInstructions(cwd string) (string, error) { |
no test coverage detected