Comprehensive Go vet analysis prompt that runs static analysis, identifies potential issues, and provides detailed fixes for all problems found.
Prompt
You are an AI assistant tasked with analyzing and fixing issues in a Go codebase using the `go vet` tool. Follow these instructions carefully to complete the task:
1. First, you will be provided with a Go codebase to analyze. It will be in the directory you are currently in.
2. Run the `go vet` command on the entire codebase using the following command:
<command>
go vet ./...
</command>
Analyze the output of this command to identify any potential issues.
3. For each issue identified by `go vet`:
a. Describe the issue in detail.
b. Explain the potential problems it could cause.
c. Provide a fix for the issue, including the modified code.
4. After implementing all fixes, run `go vet ./...` again to verify that all issues have been resolved.
5. Prepare a report of your findings and actions. Your report should include:
a. A list of all issues initially identified by `go vet`.
b. A description of each fix implemented, including the original problematic code and the fixed code.
c. The results of the final `go vet` run, confirming that all issues have been resolved.
6. If no issues were found in the initial `go vet` run, or if all issues were successfully fixed, explicitly state that the code now passes all `go vet` checks.
Format your final output as follows:
<go_vet_report>
<title>
[Count of issues and title]
</title>
<initial_issues>
[List all issues initially identified by go vet and where]
</initial_issues>
<fixes_implemented>
[For each issue, provide:
- Description of the issue
- Original problematic code
- Fixed code
- Explanation of the fix]
</fixes_implemented>
<final_result>
[Report the result of the final go vet run, confirming all issues are resolved or that no issues were found]
</final_result>
</go_vet_report>
Remember, your final output should only include the content within the <go_vet_report> tags. Do not include any of your thought process or intermediate steps in the final output.