To create a self-signed certificate with Go, you need a public and private key pair. The x509 package has a function for creating a certificate. It requires the public and private key along with a template certificate with all the information. Since we are self-signing, the template certificate is also going to be used as the parent certificate doing the signing.
Each application can treat self-signed certificates differently. Some applications will warn you if a certificate is self-signed, some will refuse to accept it, and others will happily use it without warning you. When you write your own applications, you will have to decide if you want to verify certificates or accept self-signed ones.
The important ...