code: func getListener(uri pilosa.URI, tlsconf *tls.Config) (ln net.Listener, err error) {
  	// If bind URI has the https scheme, enable TLS
  	if uri.Scheme == "https" && tlsconf != nil {
  		ln, err = tls.Listen("tcp", uri.HostPort(), tlsconf)
  		if err != nil {
  			return nil, errors.Wrap(err, "tls.Listener")
  		}
  	} else if uri.Scheme == "http" {
  		// Open HTTP listener to determine port (if specified as :0).
  		ln, err = net.Listen("tcp", uri.HostPort())
  		if err != nil {
  			return nil, errors.Wrap(err, "net.Listen")
  		}
  	} else {
  		return nil, errors.Errorf("unsupported scheme: %s", uri.Scheme)
  	}
  
  	return ln, nil
  }
docs: // getListener gets a net.Listener based on the config.