go:generate is done at dev time, not at build time.

Actually bindings are usually generated like that, at build time (though with a build cache that nobody knows how it corrupts all the time).

Examples that come to mind: webview/webview, webkit, cilium/ebpf and most other CGo projects that I have seen.