code: func WriteCert(certPath string, data []byte) error {
  	if err := os.MkdirAll(filepath.Dir(certPath), os.FileMode(0755)); err != nil {
  		return err
  	}
  	return ioutil.WriteFile(certPath, data, os.FileMode(0644))
  }
docs: // WriteCert writes the pem-encoded certificate data to certPath.
  // The certificate file will be created with file mode 0644.
  // If the certificate file already exists, it will be overwritten.
  // The parent directory of the certPath will be created as needed with file mode 0755.