Skip to content

Commit

Permalink
clientv3: s/ToOpResponse/OpResponse
Browse files Browse the repository at this point in the history
Closer to idiomatic go.
  • Loading branch information
Anthony Romano authored and visheshnp committed Aug 4, 2017
1 parent 8fe9435 commit d3716b8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions clientv3/kv.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,16 +74,16 @@ func (op OpResponse) Get() *GetResponse { return op.get }
func (op OpResponse) Del() *DeleteResponse { return op.del }
func (op OpResponse) Txn() *TxnResponse { return op.txn }

func (resp *PutResponse) ToOpResponse() OpResponse {
func (resp *PutResponse) OpResponse() OpResponse {
return OpResponse{put: resp}
}
func (resp *GetResponse) ToOpResponse() OpResponse {
func (resp *GetResponse) OpResponse() OpResponse {
return OpResponse{get: resp}
}
func (resp *DeleteResponse) ToOpResponse() OpResponse {
func (resp *DeleteResponse) OpResponse() OpResponse {
return OpResponse{del: resp}
}
func (resp *TxnResponse) ToOpResponse() OpResponse {
func (resp *TxnResponse) OpResponse() OpResponse {
return OpResponse{txn: resp}
}

Expand Down
4 changes: 2 additions & 2 deletions clientv3/ordering/kv_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ var rangeTests = []struct {

func TestKvOrdering(t *testing.T) {
for i, tt := range rangeTests {
mKV := &mockKV{clientv3.NewKVFromKVClient(nil), tt.response.ToOpResponse()}
mKV := &mockKV{clientv3.NewKVFromKVClient(nil), tt.response.OpResponse()}
kv := &kvOrdering{
mKV,
func(r *clientv3.GetResponse) OrderViolationFunc {
Expand Down Expand Up @@ -249,7 +249,7 @@ var txnTests = []struct {

func TestTxnOrdering(t *testing.T) {
for i, tt := range txnTests {
mKV := &mockKV{clientv3.NewKVFromKVClient(nil), tt.response.ToOpResponse()}
mKV := &mockKV{clientv3.NewKVFromKVClient(nil), tt.response.OpResponse()}
kv := &kvOrdering{
mKV,
func(r *clientv3.TxnResponse) OrderViolationFunc {
Expand Down

0 comments on commit d3716b8

Please sign in to comment.