You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: config_test.go
    path of file: ./repos/ziti/controller/config
    
    the code of the file until where you have to start completion: package config

import (
	"bytes"
	"crypto"
	"crypto/ecdsa"
	"crypto/elliptic"
	"crypto/rand"
	"crypto/x509"
	"crypto/x509/pkix"
	"github.com/google/uuid"
	nfpem "github.com/openziti/foundation/v2/pem"
	"github.com/stretchr/testify/require"
	"math/big"
	"testing"
	"time"
)

func Test_validateHostPortString(t *testing.T) {
	t.Run("a hostname and port should pass", func(t *testing.T) {
		req := require.New(t)

		err := validateHostPort
    
func Test_CalculateCaPems(t *testing.T) {
	ca1, _ := newSelfSignedCert(uuid.NewString(), true)
	ca2, _ := newSelfSignedCert(uuid.NewString(), true)
	ca3, _ := newSelfSignedCert(uuid.NewString(), true)

	notCaSelfSigned, _ := newSelfSignedCert(uuid.NewString(), false)

	ca1Pem := nfpem.EncodeToBytes(ca1)
	ca2Pem := nfpem.EncodeToBytes(ca2)
	ca3Pem := nfpem.EncodeToBytes(ca3)
	notCaSelfSignedPem := nfpem.EncodeToBytes(notCaSelfSigned)

	inCas := []*x509.Certificate{
		ca1,
		ca2,
		ca3,
	}

	t.Run("1 non-ca in, 0 out", func(t *testing.T) {
		req := require.New(t)

		buf := bytes.NewBuffer([]byte{})

		buf.Write(notCaSelfSignedPem)

		outBuf := CalculateCaPems(buf)

		outCerts := nfpem.PemBytesToCertificates(outBuf.Bytes())

		req.Len(outCerts, 0)
	})

	t.Run("1 non-ca + 3 ca in, 3 out", func(t *testing.T) {
		req := require.New(t)

		buf := bytes.NewBuffer([]byte{})

		buf.Write(notCaSelfSignedPem)
		buf.Write(ca1Pem)
		buf.Write(ca2Pem)
		buf.Write(ca3Pem)

		outBuf := CalculateCaPems(buf)

		outCerts := nfpem.PemBytesToCertificates(outBuf.Bytes())

		req.Len(outCerts, 3)

		for _, inCert := range inCas {
			found := false
			for _, outCert := range outCerts {
				if bytes.Equal(inCert.Raw, outCert.Raw) {
					req.Falsef(found, "certificate %s was found multiple times, expected once instance in output", inCert.Subject.String())

					found = true
				}
			}
			req.Truef(found, "certificate %s was provided as input but not found as output", inCert.Subject.String())
		}
	})

	t.Run("three unique CAs in, three out", func(t *testing.T) {
		req := require.New(t)

		buf := bytes.NewBuffer([]byte{})

		buf.Write(ca1Pem)
		buf.Write(ca2Pem)
		buf.Write(ca3Pem)

		outBuf := CalculateCaPems(buf)

		outCerts := nfpem.PemBytesToCertificates(outBuf.Bytes())

		req.Len(outCerts, 3)

		for _, inCert := range inCas {
			found := false
			for _, outCert := range outCerts {
				if bytes.Equal(inCert.Raw, outCert.Raw) {
					req.Falsef(found, "certificate %s was found multiple times, expected once instance in output", inCert.Subject.String())

					found = true
				}
			}
			req.Truef(found, "certificate %s was provided as input but not found as output", inCert.Subject.String())
		}
	})

	t.Run("0 unique CAs in, 0 out", func(t *testing.T) {
		req := require.New(t)

		buf := bytes.NewBuffer([]byte{})

		outBuf := CalculateCaPems(buf)

		outCerts := nfpem.PemBytesToCertificates(outBuf.Bytes())

		req.Len(outCerts, 0)
	})

	t.Run("1 unique CAs in, 1 out", func(t *testing.T) {
		req := require.New(t)

		buf := bytes.NewBuffer([]byte{})

		buf.Write(ca1Pem)

		outBuf := CalculateCaPems(buf)

		outCerts := nfpem.PemBytesToCertificates(outBuf.Bytes())

		req.Len(outCerts, 1)

		req.True(bytes.Equal(outCerts[0].Raw, ca1.Raw), "the in ca did not match the out ca")
	})

	t.Run("2 duplicate CAs in, 1 out", func(t *testing.T) {
		req := require.New(t)

		buf := bytes.NewBuffer([]byte{})

		buf.Write(ca1Pem)
		buf.Write(ca1Pem)

		outBuf := CalculateCaPems(buf)

		outCerts := nfpem.PemBytesToCertificates(outBuf.Bytes())

		req.Len(outCerts, 1)

		req.True(bytes.Equal(outCerts[0].Raw, ca1.Raw), "the in ca did not match the out ca")
	})

	t.Run("2 sets of 2 duplicate CAs in and 1 unique, 3 unique out", func(t *testing.T) {
		req := require.New(t)

		buf := bytes.NewBuffer([]byte{})

		buf.Write(ca1Pem) //uniques
		buf.Write(ca2Pem)
		buf.Write(ca3Pem)

		buf.Write(ca1Pem) //dupe 1
		buf.Write(ca2Pem) //dupe 2

		outBuf := CalculateCaPems(buf)

		outCerts := nfpem.PemBytesToCertificates(outBuf.Bytes())

		req.Len(outCerts, 3)

		for _, inCert := range inCas {
			found := false
			for _, outCert := range outCerts {
				if bytes.Equal(inCert.Raw, outCert.Raw) {
					req.Falsef(found, "certificate %s was found multiple times, expected once instance in output", inCert.Subject.String())

					found = true
				}
			}
			req.Truef(found, "certificate %s was provided as input but not found as output", inCert.Subject.String())
		}
	})

}