Skip to content

Commit 954d5a5

Browse files
committed
lint issue
1 parent 8bcf2b7 commit 954d5a5

File tree

3 files changed

+10
-9
lines changed

3 files changed

+10
-9
lines changed

db/hybrid_logical_vector.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -693,12 +693,12 @@ func (hlv HybridLogicalVector) GoString() string {
693693
}
694694

695695
// ErrNoNewVersionsToAdd will be thrown when there are no new versions from incoming HLV to be added to HLV that is local
696-
var ErrNoNewVersionsToAdd = errors.New("no new versions to add to HLV")
696+
var ErrNoNewVersionsToAdd = errors.New("no new versions to add to HLV")
697697

698698
// IsInConflict is used to identify if two HLV's are in conflict or not. Will return boolean to indicate if in conflict
699699
// or not and will error for the following cases:
700-
// - Local HLV dominates incoming HLV (meaning local version is a newer version that the incoming one)
701-
// - Local CV matches incoming CV, so no new versions to add
700+
// - Local HLV dominates incoming HLV (meaning local version is a newer version that the incoming one)
701+
// - Local CV matches incoming CV, so no new versions to add
702702
func IsInConflict(ctx context.Context, localHLV, incomingHLV *HybridLogicalVector) (bool, error) {
703703
incomingCV := incomingHLV.ExtractCurrentVersionFromHLV()
704704
localCV := localHLV.ExtractCurrentVersionFromHLV()

db/hybrid_logical_vector_test.go

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1434,14 +1434,14 @@ func TestIsInConflict(t *testing.T) {
14341434
incomingHLV: "112@abc;123@ghi",
14351435
},
14361436
{
1437-
name: "local revision is newer",
1438-
localHLV: "111@abc;123@def",
1439-
incomingHLV: "100@abc;123@ghi",
1437+
name: "local revision is newer",
1438+
localHLV: "111@abc;123@def",
1439+
incomingHLV: "100@abc;123@ghi",
14401440
expectedError: true,
14411441
},
14421442
{
1443-
name: "merge versions match",
1444-
localHLV: "130@abc,123@def,100@ghi;50@jkl",
1443+
name: "merge versions match",
1444+
localHLV: "130@abc,123@def,100@ghi;50@jkl",
14451445
incomingHLV: "150@mno,123@def,100@ghi;50@jkl",
14461446
},
14471447
}
@@ -1450,6 +1450,7 @@ func TestIsInConflict(t *testing.T) {
14501450
localHLV, _, err := extractHLVFromBlipString(tc.localHLV)
14511451
require.NoError(t, err)
14521452
incomingHLV, _, err := extractHLVFromBlipString(tc.incomingHLV)
1453+
require.NoError(t, err)
14531454

14541455
inConflict, err := IsInConflict(t.Context(), localHLV, incomingHLV)
14551456
if tc.expectedError {

rest/utilities_testing_blip_client.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ func (cd *clientDoc) _hasConflict(t testing.TB, incomingHLV *db.HybridLogicalVec
329329
require.FailNow(t, fmt.Sprintf("incoming CV %#+v is equal to local revision %#+v - this should've been filtered via changes response before ending up as a rev. This is only true if there is a single replication occurring, two simultaneous replications (e.g. P2P) could cause this. If there are multiple replications, modify code.", incomingCV, latestRev))
330330
}
331331

332-
inConflict, err := db.IsInConflict(nil, &localHLV, incomingHLV)
332+
inConflict, err := db.IsInConflict(t.Context(), &localHLV, incomingHLV)
333333
if err != nil {
334334
require.FailNow(t, fmt.Sprintf("incoming CV %#+v has lower version than the local revision %#+v - this should've been filtered via changes response before ending up as a rev. blip tester would reply that to Sync Gateway that it doesn't need this revision", incomingCV, localHLV))
335335
}

0 commit comments

Comments
 (0)