Repository: etcd-io/etcd
File: tests/robustness/model/history.go (Go)

Code before:
	if err != nil {
		h.appendFailed(request, start, end, err)
		return
	}
	var respRevision int64
	var respMemberID uint64
	if resp != nil && resp.Header != nil {
		respRevision = resp.Header.Revision
		respMemberID = resp.Header.MemberId
	}
	h.appendSuccessful(request, start, end, rangeResponseWithMemberID(resp.Kvs, resp.Count, respRevision, MemberID(respMemberID)))
}

func (h *AppendableHistory) AppendPut(key, value string, start, end time.Duration, resp *clientv3.PutResponse, err error) {
	request := putRequest(key, value)
	if err != nil {
		h.appendFailed(request, start, end, err)
		return
	}
	var revision int64
	var memberID uint64
	if resp != nil && resp.Header != nil {
		revision = resp.Header.Revision
		memberID = resp.Header.MemberId
	}
	h.appendSuccessful(request, start, end, putResponseWithMemberID(revision, MemberID(memberID)))
}

func (h *AppendableHistory) AppendPutWithLease(key, value string, leaseID int64, start, end time.Duration, resp *clientv3.PutResponse, err error) {
	request := putWithLeaseRequest(key, value, leaseID)
	if err != nil {
		h.appendFailed(request, start, end, err)
		return
	}
	var revision int64
	var memberID uint64
	if resp != nil && resp.Header != nil {
		revision = resp.Header.Revision
		memberID = resp.Header.MemberId
	}
	h.appendSuccessful(request, start, end, putResponseWithMemberID(revision, MemberID(memberID)))
}

func (h *AppendableHistory) AppendLeaseGrant(start, end time.Duration, resp *clientv3.LeaseGrantResponse, err error) {
	var leaseID int64
	if resp != nil {
		leaseID = int64(resp.ID)
	}
	request := leaseGrantRequest(leaseID)
	if err != nil {
		h.appendFailed(request, start, end, err)

Review comment (suggestion):
```suggestion
	h.appendSuccessful(request, start, end, putResponseWithMemberID(revision, memberID))
```

Code after:
	if err != nil {
		h.appendFailed(request, start, end, err)
		return
	}
	var respRevision int64
	var respMemberID uint64
	if resp != nil && resp.Header != nil {
		respRevision = resp.Header.Revision
		respMemberID = resp.Header.MemberId
	}
	h.appendSuccessful(request, start, end, rangeResponseWithMemberID(resp.Kvs, resp.Count, respRevision, MemberID(respMemberID)))
}

func (h *AppendableHistory) AppendPut(key, value string, start, end time.Duration, resp *clientv3.PutResponse, err error) {
	request := putRequest(key, value)
	if err != nil {
		h.appendFailed(request, start, end, err)
		return
	}
	var revision int64
	var memberID MemberID
	if resp != nil && resp.Header != nil {
		revision = resp.Header.Revision
		memberID = MemberID(resp.Header.MemberId)
	}
	h.appendSuccessful(request, start, end, putResponseWithMemberID(revision, memberID))
}

func (h *AppendableHistory) AppendPutWithLease(key, value string, leaseID int64, start, end time.Duration, resp *clientv3.PutResponse, err error) {
	request := putWithLeaseRequest(key, value, leaseID)
	if err != nil {
		h.appendFailed(request, start, end, err)
		return
	}
	var revision int64
	var memberID MemberID
	if resp != nil && resp.Header != nil {
		revision = resp.Header.Revision
		memberID = MemberID(resp.Header.MemberId)
	}
	h.appendSuccessful(request, start, end, putResponseWithMemberID(revision, memberID))
}

func (h *AppendableHistory) AppendLeaseGrant(start, end time.Duration, resp *clientv3.LeaseGrantResponse, err error) {
	var leaseID int64
	if resp != nil {
		leaseID = int64(resp.ID)
	}
	request := leaseGrantRequest(leaseID)
	if err != nil {
		h.appendFailed(request, start, end, err)