On that call a few days ago, y’all asked for examples of where Cody could have done better.
func CreateHomeSystemTemplate(db *sqlc.DB, numberOfPlanets int) error {
planets := generate_planets(100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100,
The signature for generate_planets
is
func generate_planets(star *star_data_t, num_planets int, earth_like, makeMiningEasier bool) [10]*planet_data_t
A better result would have been
func CreateHomeSystemTemplate(db *sqlc.DB, numberOfPlanets int) error {
planets := generate_planets(nil, numberOfPlanets, true, true)
Guessing the values for those two bools would have been better than repeating the number 100 almost 50 times in a row.
JetBrains Goland, v7.0.18 of the plugin.