Ver Fonte

*: make receiver names consistent

Anthony Romano há 8 anos atrás
pai
commit
4fa1dd196c
4 ficheiros alterados com 13 adições e 13 exclusões
  1. 1 1
      clientv3/concurrency/election.go
  2. 2 2
      clientv3/namespace/kv.go
  3. 3 3
      mvcc/index.go
  4. 7 7
      pkg/report/timeseries.go

+ 1 - 1
clientv3/concurrency/election.go

@@ -242,4 +242,4 @@ func (e *Election) Key() string { return e.leaderKey }
 func (e *Election) Rev() int64 { return e.leaderRev }
 
 // Header is the response header from the last successful election proposal.
-func (m *Election) Header() *pb.ResponseHeader { return m.hdr }
+func (e *Election) Header() *pb.ResponseHeader { return e.hdr }

+ 2 - 2
clientv3/namespace/kv.go

@@ -180,8 +180,8 @@ func (kv *kvPrefix) unprefixTxnResponse(resp *clientv3.TxnResponse) {
 	}
 }
 
-func (p *kvPrefix) prefixInterval(key, end []byte) (pfxKey []byte, pfxEnd []byte) {
-	return prefixInterval(p.pfx, key, end)
+func (kv *kvPrefix) prefixInterval(key, end []byte) (pfxKey []byte, pfxEnd []byte) {
+	return prefixInterval(kv.pfx, key, end)
 }
 
 func (kv *kvPrefix) prefixCmps(cs []clientv3.Cmp) []clientv3.Cmp {

+ 3 - 3
mvcc/index.go

@@ -221,16 +221,16 @@ func compactIndex(rev int64, available map[revision]struct{}, emptyki *[]*keyInd
 	}
 }
 
-func (a *treeIndex) Equal(bi index) bool {
+func (ti *treeIndex) Equal(bi index) bool {
 	b := bi.(*treeIndex)
 
-	if a.tree.Len() != b.tree.Len() {
+	if ti.tree.Len() != b.tree.Len() {
 		return false
 	}
 
 	equal := true
 
-	a.tree.Ascend(func(item btree.Item) bool {
+	ti.tree.Ascend(func(item btree.Item) bool {
 		aki := item.(*keyIndex)
 		bki := b.tree.Get(item).(*keyIndex)
 		if !aki.equal(bki) {

+ 7 - 7
pkg/report/timeseries.go

@@ -118,20 +118,20 @@ func (sp *secondPoints) getTimeSeries() TimeSeries {
 	return tslice
 }
 
-func (ts TimeSeries) String() string {
+func (t TimeSeries) String() string {
 	buf := new(bytes.Buffer)
 	wr := csv.NewWriter(buf)
 	if err := wr.Write([]string{"UNIX-SECOND", "MIN-LATENCY-MS", "AVG-LATENCY-MS", "MAX-LATENCY-MS", "AVG-THROUGHPUT"}); err != nil {
 		log.Fatal(err)
 	}
 	rows := [][]string{}
-	for i := range ts {
+	for i := range t {
 		row := []string{
-			fmt.Sprintf("%d", ts[i].Timestamp),
-			ts[i].MinLatency.String(),
-			ts[i].AvgLatency.String(),
-			ts[i].MaxLatency.String(),
-			fmt.Sprintf("%d", ts[i].ThroughPut),
+			fmt.Sprintf("%d", t[i].Timestamp),
+			t[i].MinLatency.String(),
+			t[i].AvgLatency.String(),
+			t[i].MaxLatency.String(),
+			fmt.Sprintf("%d", t[i].ThroughPut),
 		}
 		rows = append(rows, row)
 	}