Audit this Go codebase and aggressively simplify AI-generated, defensive, overly abstract, or unnecessarily generic code.
The goal is to make the code look like it was written by an experienced Go engineer:
- simple
- explicit
- strongly typed
- boring
Audit this Go codebase and aggressively simplify AI-generated, defensive, overly abstract, or unnecessarily generic code.
The goal is to make the code look like it was written by an experienced Go engineer:
| package main | |
| import ( | |
| "log" | |
| "net/http" | |
| "strings" | |
| ) | |
| /* | |
| Returns a map array of all available headers. |
NOTE: This is a question I found on StackOverflow which I’ve archived here, because the answer is so effing phenomenal.
If you are not into long explanations, see [Paolo Bergantino’s answer][2].