reduce the local scope of variable

This commit is contained in:
R.B. Boyer 2019-02-01 10:00:38 -06:00
parent 655ef53749
commit 3b60891bf8
1 changed files with 1 additions and 2 deletions

View File

@ -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