const testCertPEM … const expectedHash … const testCert2PEM … // testCert is a small helper to get a test x509.Certificate from the PEM constants func testCert(t *testing.T, pemString string) *x509.Certificate { … } func TestSet(t *testing.T) { … } func TestHash(t *testing.T) { … }