1
0
mirror of https://github.com/StackExchange/dnscontrol.git synced 2024-05-11 05:55:12 +00:00

Vet and Lint the entire system (#296)

* govet and golint corrections
This commit is contained in:
Tom Limoncelli
2018-01-09 12:53:16 -05:00
committed by GitHub
parent 1a91a7f536
commit b7c251190f
64 changed files with 540 additions and 433 deletions

View File

@@ -93,11 +93,15 @@ func generateFeatureMatrix() error {
return ioutil.WriteFile("docs/_includes/matrix.html", buf.Bytes(), 0644)
}
// FeatureDef describes features.
type FeatureDef struct {
Name, Desc string
}
// FeatureMap maps provider names to compliance documentation.
type FeatureMap map[string]*providers.DocumentationNote
// SetSimple configures a provider's setting in fm.
func (fm FeatureMap) SetSimple(name string, unknownsAllowed bool, f func() bool) {
if f() {
fm[name] = &providers.DocumentationNote{HasFeature: true}
@@ -106,6 +110,7 @@ func (fm FeatureMap) SetSimple(name string, unknownsAllowed bool, f func() bool)
}
}
// FeatureMatrix describes features and which providers support it.
type FeatureMatrix struct {
Features []FeatureDef
Providers map[string]FeatureMap