Think of this as a way to have a file with package main, and a func main that does not interfere with your normal build process...
The best example of this, and a decent util is this:
https://go.dev/src/crypto/tls/generate_cert.go
All of the real testing happens elsewhere this just provides utility.