From 2c983902be18192765de0106cf4669d128295a3b Mon Sep 17 00:00:00 2001 From: "R.B. Boyer" Date: Fri, 1 Feb 2019 10:00:38 -0600 Subject: [PATCH] reduce the local scope of variable --- agent/consul/state/acl.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/agent/consul/state/acl.go b/agent/consul/state/acl.go index e9dc970cf9..480de1757c 100644 --- a/agent/consul/state/acl.go +++ b/agent/consul/state/acl.go @@ -641,14 +641,13 @@ func (s *Store) aclPolicySetTxn(tx *memdb.Txn, idx uint64, policy *structs.ACLPo return ErrMissingACLPolicyName } - var policyMatch *structs.ACLPolicy existing, err := tx.First("acl-policies", "id", policy.ID) if err != nil { return fmt.Errorf("failed acl policy lookup: %v", err) } if existing != nil { - policyMatch = existing.(*structs.ACLPolicy) + policyMatch := existing.(*structs.ACLPolicy) if policy.ID == structs.ACLPolicyGlobalManagementID { // Only the name and description are modifiable