为什么grpc服务器示例使用net.Listen而不是tls.Listen [关闭]

I'm setting up a golang grpc server that will use TLS for client authorization/authentication. All the examples of server setup that I've seen use net.Listen() instead of tls.Listen(). Why is this?

import (
    "crypto/tls"
    "github.com/pkg/errors"
    "google.golang.org/grpc"
    "google.golang.org/grpc/credentials"
    "net"
)

func startGRPCListener(hostport string, tlsconfig *tls.Config) (grpcServer *grpc.Server) {
    listener, _ = net.Listen("tcp", hostport)
    cred := grpc.Creds(credentials.NewTLS(tlsconfig))
    grpcServer := grpc.NewServer(cred)
    go func() {
        serveErr := grpcServer.Serve(listener)
        log.WithError(serveErr).Info("GRPC server exited")
    }() 

    return
}

I've noticed in a couple of working examples if I swap to tls.Listen, the connection can no longer be made. However, in other cases, this doesn't cause a problem!

I guess my question is "should I use net.Listen or tls.Listen, or does it not make a difference?"

Why is this?

Because these are examples about grpc and not about TLS? Examples tend to be examples: Simplifications to demonstrate something. Examples are not copy-paste samples for production code.