Sfoglia il codice sorgente

Fix linting issues

Herman Slatman 4 anni fa
parent
commit
ff08b5055e
1 ha cambiato i file con 2 aggiunte e 3 eliminazioni
  1. 2 3
      policy/engine.go

+ 2 - 3
policy/engine.go

@@ -31,8 +31,7 @@ type NamePolicyError struct {
 }
 }
 
 
 func (e NamePolicyError) Error() string {
 func (e NamePolicyError) Error() string {
-	switch e.Reason {
-	case NotAuthorizedForThisName:
+	if e.Reason == NotAuthorizedForThisName {
 		return "not authorized to sign for this name: " + e.Detail
 		return "not authorized to sign for this name: " + e.Detail
 	}
 	}
 	return "unknown error"
 	return "unknown error"
@@ -340,7 +339,7 @@ func (e *NamePolicyEngine) validateNames(dnsNames []string, ips []net.IP, emailA
 		if e.numberOfPrincipalConstraints == 0 && e.totalNumberOfPermittedConstraints > 0 {
 		if e.numberOfPrincipalConstraints == 0 && e.totalNumberOfPermittedConstraints > 0 {
 			return NamePolicyError{
 			return NamePolicyError{
 				Reason: NotAuthorizedForThisName,
 				Reason: NotAuthorizedForThisName,
-				Detail: fmt.Sprintf("username principal %q is not explicity permitted by any constraint", username),
+				Detail: fmt.Sprintf("username principal %q is not explicitly permitted by any constraint", username),
 			}
 			}
 		}
 		}
 		// TODO: some validation? I.e. allowed characters?
 		// TODO: some validation? I.e. allowed characters?