refactor(recipes): update result-refactor recipe for broader package path and error handling
- Change default package_path from internal/service to internal for wider applicability. - Add instruction to output a specific message if no files are found or path does not exist in Step 1.
This commit is contained in:
parent
0ba427aaf6
commit
5d0aec721d
@ -6,7 +6,7 @@ version: 1.0
|
||||
parameters:
|
||||
package_path:
|
||||
type: string
|
||||
default: internal/service
|
||||
default: internal
|
||||
description: Package to refactor
|
||||
dry_run:
|
||||
type: bool
|
||||
@ -33,6 +33,7 @@ Refactors all error handling in the target package to use the new Result[T] patt
|
||||
### Step 1: Discover files
|
||||
**Objective:** Find every file that needs changing.
|
||||
**Instructions:** Recursively scan `{{.package_path}}` for `.go` files containing `if err != nil`.
|
||||
If no files are found or the path does not exist, output exactly: "No files found matching the criteria."
|
||||
**Expected output:** A clean numbered list of full file paths (one per line).
|
||||
|
||||
### Step 2: Refactor each file
|
||||
|
||||
Loading…
Reference in New Issue
Block a user