func canonicalNetworkAddress(address string) string {
	_, _, err := net.SplitHostPort(address)
	if err != nil {
		ip := net.ParseIP(address)
		if ip != nil && ip.To4() == nil {
			address = fmt.Sprintf("[%s]:%s", address, DefaultPort)
		} else {
			address = fmt.Sprintf("%s:%s", address, DefaultPort)
		}
	}
	return address
}
canonicalNetworkAddress parses the given network address and returns a
string of the form "host:port", possibly filling it with the default port if
it's missing.
package endpoints
import (
	"crypto/tls"
	"fmt"
	"net"
	"sync"
	"github.com/go-kit/kit/log"
	"github.com/go-kit/kit/log/level"
	"github.com/pkg/errors"
	"github.com/spoke-d/thermionic/internal/cert"
)
func networkCreateListener(address string, cert *cert.Info, logger log.Logger) net.Listener {
	listener, err := net.Listen("tcp", canonicalNetworkAddress(address))
	if err != nil {
		level.Error(logger).Log("msg", "Cannot listen on https socket, skipping...", "err", err)
		return nil
	}
	return networkTLSListener(listener, cert, logger)
}