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

@@ -52,6 +52,9 @@ func (h *dnsContext) saveConfig(key string, cfg *Config) {
h.keysToConfigs[key] = cfg
}
// Compile-time check to ensure dnsContext implements the caddy.Context interface
var _ caddy.Context = &dnsContext{}
// InspectServerBlocks make sure that everything checks out before
// executing directives and otherwise prepares the directives to
// be parsed and executed.