The PokemonCommand() function has several inline anonymous functions that aren't easily testable or readable.
The functions will move to standalone package-level functions in a new cmd/pokemon/render.go file.
Each function now accepts the relevant struct as a parameter instead of closing over variables in the outer scope, making them independently testable without going through the full command.
The
PokemonCommand()function has several inline anonymous functions that aren't easily testable or readable.The functions will move to standalone package-level functions in a new
cmd/pokemon/render.gofile.Each function now accepts the relevant struct as a parameter instead of closing over variables in the outer scope, making them independently testable without going through the full command.