aboutsummaryrefslogtreecommitdiff
path: root/core/dnsserver/server.go
diff options
context:
space:
mode:
authorGravatar Zou Nengren <zounengren@cmss.chinamobile.com> 2020-03-06 16:25:07 +0800
committerGravatar GitHub <noreply@github.com> 2020-03-06 09:25:07 +0100
commita74a209129fd832b1d68c9de1b5d0c265b78c3a1 (patch)
treecc2249ecdc6dafbf191f0be13e22aa370d98750d /core/dnsserver/server.go
parentb8e96b61fc1189c3e5240319e470eb7a6d10f3c6 (diff)
downloadcoredns-a74a209129fd832b1d68c9de1b5d0c265b78c3a1.tar.gz
coredns-a74a209129fd832b1d68c9de1b5d0c265b78c3a1.tar.zst
coredns-a74a209129fd832b1d68c9de1b5d0c265b78c3a1.zip
validate object implements the corresponding interface (#3724)
Signed-off-by: zouyee <zounengren@cmss.chinamobile.com>
Diffstat (limited to 'core/dnsserver/server.go')
-rw-r--r--core/dnsserver/server.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/core/dnsserver/server.go b/core/dnsserver/server.go
index 9b8fb23e4..b5bc14a63 100644
--- a/core/dnsserver/server.go
+++ b/core/dnsserver/server.go
@@ -20,6 +20,7 @@ import (
"github.com/coredns/coredns/plugin/pkg/transport"
"github.com/coredns/coredns/request"
+ "github.com/caddyserver/caddy"
"github.com/miekg/dns"
ot "github.com/opentracing/opentracing-go"
)
@@ -99,6 +100,9 @@ func NewServer(addr string, group []*Config) (*Server, error) {
return s, nil
}
+// Compile-time check to ensure Server implements the caddy.GracefulServer interface
+var _ caddy.GracefulServer = &Server{}
+
// Serve starts the server with an existing listener. It blocks until the server stops.
// This implements caddy.TCPServer interface.
func (s *Server) Serve(l net.Listener) error {