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

Lint: Fix ST1005: error strings should not be capitalized (#834)

This commit is contained in:
Tom Limoncelli
2020-08-30 19:52:37 -04:00
committed by GitHub
parent ca136992f8
commit de308c0952
37 changed files with 98 additions and 94 deletions

View File

@@ -126,7 +126,7 @@ func preloadProviders(cfg *models.DNSConfig, err error) (*models.DNSConfig, erro
for _, d := range cfg.Domains {
reg, ok := cfg.RegistrarsByName[d.RegistrarName]
if !ok {
return nil, fmt.Errorf("Registrar named %s expected for %s, but never registered", d.RegistrarName, d.Name)
return nil, fmt.Errorf("registrar named %s expected for %s, but never registered", d.RegistrarName, d.Name)
}
d.RegistrarInstance = &models.RegistrarInstance{
ProviderBase: models.ProviderBase{

View File

@@ -126,10 +126,10 @@ func GetCerts(args GetCertsArgs) error {
fmt.Println(args.JSFile)
// check agree flag
if !args.AgreeTOS {
return fmt.Errorf("You must agree to the Let's Encrypt Terms of Service by using -agreeTOS")
return fmt.Errorf("you must agree to the Let's Encrypt Terms of Service by using -agreeTOS")
}
if args.Email == "" {
return fmt.Errorf("Must provide email to use for Let's Encrypt registration")
return fmt.Errorf("must provide email to use for Let's Encrypt registration")
}
// load dns config
@@ -139,7 +139,7 @@ func GetCerts(args GetCertsArgs) error {
}
errs := normalize.ValidateAndNormalizeConfig(cfg)
if PrintValidationErrors(errs) {
return fmt.Errorf("Exiting due to validation errors")
return fmt.Errorf("exiting due to validation errors")
}
notifier, err := InitializeProviders(args.CredsFile, cfg, args.Notify)
if err != nil {
@@ -163,7 +163,7 @@ func GetCerts(args GetCertsArgs) error {
return err
}
if len(certList) == 0 {
return fmt.Errorf("Must provide at least one certificate to issue in cert configuration")
return fmt.Errorf("must provide at least one certificate to issue in cert configuration")
}
if err = validateCertificateList(certList, cfg); err != nil {
return err

View File

@@ -101,7 +101,7 @@ func run(args PreviewArgs, push bool, interactive bool, out printer.CLI) error {
}
errs := normalize.ValidateAndNormalizeConfig(cfg)
if PrintValidationErrors(errs) {
return fmt.Errorf("Exiting due to validation errors")
return fmt.Errorf("exiting due to validation errors")
}
// TODO:
notifier, err := InitializeProviders(args.CredsFile, cfg, args.Notify)
@@ -169,10 +169,10 @@ DomainLoop:
notifier.Done()
out.Printf("Done. %d corrections.\n", totalCorrections)
if anyErrors {
return fmt.Errorf("Completed with errors")
return fmt.Errorf("completed with errors")
}
if totalCorrections != 0 && args.WarnChanges {
return fmt.Errorf("There are pending changes")
return fmt.Errorf("there are pending changes")
}
return nil
}

View File

@@ -72,7 +72,7 @@ func PrintIR(args PrintIRArgs) error {
if !args.Raw {
errs := normalize.ValidateAndNormalizeConfig(cfg)
if PrintValidationErrors(errs) {
return fmt.Errorf("Exiting due to validation errors")
return fmt.Errorf("exiting due to validation errors")
}
}
return PrintJSON(args.PrintJSONArgs, cfg)
@@ -98,12 +98,12 @@ func PrintValidationErrors(errs []error) (fatal bool) {
// ExecuteDSL executes the dnsconfig.js contents.
func ExecuteDSL(args ExecuteDSLArgs) (*models.DNSConfig, error) {
if args.JSFile == "" {
return nil, fmt.Errorf("No config specified")
return nil, fmt.Errorf("no config specified")
}
dnsConfig, err := js.ExecuteJavascript(args.JSFile, args.DevMode)
if err != nil {
return nil, fmt.Errorf("Executing javascript in %s: %s", args.JSFile, err)
return nil, fmt.Errorf("executing javascript in %s: %s", args.JSFile, err)
}
return dnsConfig, nil
}