From ff08b5055ed300a62c7b034aab483ec8b24f6a55 Mon Sep 17 00:00:00 2001 From: Herman Slatman Date: Tue, 18 Jan 2022 14:42:56 +0100 Subject: [PATCH] Fix linting issues --- policy/engine.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/policy/engine.go b/policy/engine.go index f850ecf3..4c102fd6 100755 --- a/policy/engine.go +++ b/policy/engine.go @@ -31,8 +31,7 @@ type NamePolicyError struct { } 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 "unknown error" @@ -340,7 +339,7 @@ func (e *NamePolicyEngine) validateNames(dnsNames []string, ips []net.IP, emailA if e.numberOfPrincipalConstraints == 0 && e.totalNumberOfPermittedConstraints > 0 { return NamePolicyError{ 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?