validate object implements the corresponding interface (#3724)

Signed-off-by: zouyee <zounengren@cmss.chinamobile.com>
This commit is contained in:
Zou Nengren
2020-03-06 16:25:07 +08:00
committed by GitHub
parent b8e96b61fc
commit a74a209129
5 changed files with 20 additions and 0 deletions

View File

@@ -11,6 +11,7 @@ import (
"github.com/coredns/coredns/plugin/pkg/reuseport"
"github.com/coredns/coredns/plugin/pkg/transport"
"github.com/caddyserver/caddy"
"github.com/grpc-ecosystem/grpc-opentracing/go/otgrpc"
"github.com/miekg/dns"
"github.com/opentracing/opentracing-go"
@@ -43,6 +44,9 @@ func NewServergRPC(addr string, group []*Config) (*ServergRPC, error) {
return &ServergRPC{Server: s, tlsConfig: tlsConfig}, nil
}
// Compile-time check to ensure Server implements the caddy.GracefulServer interface
var _ caddy.GracefulServer = &Server{}
// Serve implements caddy.TCPServer interface.
func (s *ServergRPC) Serve(l net.Listener) error {
s.m.Lock()