mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
clientv3: s/ToOpResponse/OpResponse
Closer to idiomatic go.
This commit is contained in:
parent
8fe94356f4
commit
d3716b86ae
@ -74,16 +74,16 @@ func (op OpResponse) Get() *GetResponse { return op.get }
|
|||||||
func (op OpResponse) Del() *DeleteResponse { return op.del }
|
func (op OpResponse) Del() *DeleteResponse { return op.del }
|
||||||
func (op OpResponse) Txn() *TxnResponse { return op.txn }
|
func (op OpResponse) Txn() *TxnResponse { return op.txn }
|
||||||
|
|
||||||
func (resp *PutResponse) ToOpResponse() OpResponse {
|
func (resp *PutResponse) OpResponse() OpResponse {
|
||||||
return OpResponse{put: resp}
|
return OpResponse{put: resp}
|
||||||
}
|
}
|
||||||
func (resp *GetResponse) ToOpResponse() OpResponse {
|
func (resp *GetResponse) OpResponse() OpResponse {
|
||||||
return OpResponse{get: resp}
|
return OpResponse{get: resp}
|
||||||
}
|
}
|
||||||
func (resp *DeleteResponse) ToOpResponse() OpResponse {
|
func (resp *DeleteResponse) OpResponse() OpResponse {
|
||||||
return OpResponse{del: resp}
|
return OpResponse{del: resp}
|
||||||
}
|
}
|
||||||
func (resp *TxnResponse) ToOpResponse() OpResponse {
|
func (resp *TxnResponse) OpResponse() OpResponse {
|
||||||
return OpResponse{txn: resp}
|
return OpResponse{txn: resp}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -195,7 +195,7 @@ var rangeTests = []struct {
|
|||||||
|
|
||||||
func TestKvOrdering(t *testing.T) {
|
func TestKvOrdering(t *testing.T) {
|
||||||
for i, tt := range rangeTests {
|
for i, tt := range rangeTests {
|
||||||
mKV := &mockKV{clientv3.NewKVFromKVClient(nil), tt.response.ToOpResponse()}
|
mKV := &mockKV{clientv3.NewKVFromKVClient(nil), tt.response.OpResponse()}
|
||||||
kv := &kvOrdering{
|
kv := &kvOrdering{
|
||||||
mKV,
|
mKV,
|
||||||
func(r *clientv3.GetResponse) OrderViolationFunc {
|
func(r *clientv3.GetResponse) OrderViolationFunc {
|
||||||
@ -249,7 +249,7 @@ var txnTests = []struct {
|
|||||||
|
|
||||||
func TestTxnOrdering(t *testing.T) {
|
func TestTxnOrdering(t *testing.T) {
|
||||||
for i, tt := range txnTests {
|
for i, tt := range txnTests {
|
||||||
mKV := &mockKV{clientv3.NewKVFromKVClient(nil), tt.response.ToOpResponse()}
|
mKV := &mockKV{clientv3.NewKVFromKVClient(nil), tt.response.OpResponse()}
|
||||||
kv := &kvOrdering{
|
kv := &kvOrdering{
|
||||||
mKV,
|
mKV,
|
||||||
func(r *clientv3.TxnResponse) OrderViolationFunc {
|
func(r *clientv3.TxnResponse) OrderViolationFunc {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user