From 3b60891bf8e4758f39a1d7e3c1cf0b1e81811e3a 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 e9dc970cf..480de1757 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