mirror of https://github.com/status-im/consul.git
reduce the local scope of variable
This commit is contained in:
parent
a7de668260
commit
2c983902be
|
@ -641,14 +641,13 @@ func (s *Store) aclPolicySetTxn(tx *memdb.Txn, idx uint64, policy *structs.ACLPo
|
||||||
return ErrMissingACLPolicyName
|
return ErrMissingACLPolicyName
|
||||||
}
|
}
|
||||||
|
|
||||||
var policyMatch *structs.ACLPolicy
|
|
||||||
existing, err := tx.First("acl-policies", "id", policy.ID)
|
existing, err := tx.First("acl-policies", "id", policy.ID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("failed acl policy lookup: %v", err)
|
return fmt.Errorf("failed acl policy lookup: %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if existing != nil {
|
if existing != nil {
|
||||||
policyMatch = existing.(*structs.ACLPolicy)
|
policyMatch := existing.(*structs.ACLPolicy)
|
||||||
|
|
||||||
if policy.ID == structs.ACLPolicyGlobalManagementID {
|
if policy.ID == structs.ACLPolicyGlobalManagementID {
|
||||||
// Only the name and description are modifiable
|
// Only the name and description are modifiable
|
||||||
|
|
Loading…
Reference in New Issue