mirror of
https://github.com/StackExchange/dnscontrol.git
synced 2024-05-11 05:55:12 +00:00
Linting (#1996)
This commit is contained in:
@@ -24,9 +24,7 @@ func generateFeatureMatrix() error {
|
||||
func markdownTable(matrix *FeatureMatrix) (string, error) {
|
||||
var tableHeaders []string
|
||||
tableHeaders = append(tableHeaders, "Provider name")
|
||||
for _, featureName := range matrix.Features {
|
||||
tableHeaders = append(tableHeaders, featureName)
|
||||
}
|
||||
tableHeaders = append(tableHeaders, matrix.Features...)
|
||||
|
||||
var tableData [][]string
|
||||
for _, providerName := range allProviderNames() {
|
||||
@@ -58,9 +56,9 @@ func featureEmoji(
|
||||
return "❔"
|
||||
}
|
||||
|
||||
if featureMap[featureName].HasFeature == true {
|
||||
if featureMap[featureName].HasFeature {
|
||||
return "✅"
|
||||
} else if featureMap[featureName].Unimplemented == true {
|
||||
} else if featureMap[featureName].Unimplemented {
|
||||
return "❔"
|
||||
}
|
||||
return "❌"
|
||||
@@ -69,7 +67,7 @@ func featureEmoji(
|
||||
func matrixData() *FeatureMatrix {
|
||||
const (
|
||||
OfficialSupport = "Official Support"
|
||||
ProviderDnsProvider = "DNS Provider"
|
||||
ProviderDNSProvider = "DNS Provider"
|
||||
ProviderRegistrar = "Registrar"
|
||||
DomainModifierAlias = "ALIAS"
|
||||
DomainModifierDnssec = "AUTODNSSEC"
|
||||
@@ -91,7 +89,7 @@ func matrixData() *FeatureMatrix {
|
||||
Providers: map[string]FeatureMap{},
|
||||
Features: []string{
|
||||
OfficialSupport,
|
||||
ProviderDnsProvider,
|
||||
ProviderDNSProvider,
|
||||
ProviderRegistrar,
|
||||
DomainModifierAlias,
|
||||
DomainModifierDnssec,
|
||||
@@ -152,7 +150,7 @@ func matrixData() *FeatureMatrix {
|
||||
true,
|
||||
)
|
||||
featureMap.SetSimple(
|
||||
ProviderDnsProvider,
|
||||
ProviderDNSProvider,
|
||||
false,
|
||||
func() bool { return providers.DNSProviderTypes[providerName].Initializer != nil },
|
||||
)
|
||||
|
@@ -155,6 +155,7 @@ func generateFunctionTypes() (string, error) {
|
||||
return content, nil
|
||||
}
|
||||
|
||||
// Function is a struct the stores information about functions.
|
||||
type Function struct {
|
||||
Name string
|
||||
Params []Param
|
||||
@@ -164,6 +165,7 @@ type Function struct {
|
||||
Description string
|
||||
}
|
||||
|
||||
// Param is a struct that stores a parameter.
|
||||
type Param struct {
|
||||
Name string
|
||||
Type string
|
||||
@@ -193,9 +195,8 @@ func (f Function) formatParams() string {
|
||||
}
|
||||
if f.ObjectParam {
|
||||
return "opts: { " + strings.Join(params, "; ") + " }"
|
||||
} else {
|
||||
return strings.Join(params, ", ")
|
||||
}
|
||||
return strings.Join(params, ", ")
|
||||
}
|
||||
|
||||
func (f Function) docs() string {
|
||||
|
Reference in New Issue
Block a user