It should be trivial for you to google for go code generation and the cases and reasons for it. That you've personally never done it speaks only to the bounds of the work you've done.
https://shkspr.mobi/blog/2019/11/you-are-not-the-devils-advo...
> Again, I worked with Go in a production setting for 3+ years
The amount of time you spent doing whatever you were doing is not relevant. The google search you seek is mere keystrokes away.