all: Become a Go module (fixes #5148) (#5384)

* go mod init; rm -rf vendor

* tweak proto files and generation

* go mod vendor

* clean up build.go

* protobuf literals in tests

* downgrade gogo/protobuf
This commit is contained in:
Jakob Borg
2018-12-18 12:36:38 +01:00
committed by GitHub
parent 3cc8918eb4
commit 944ddcf768
1410 changed files with 66232 additions and 688356 deletions

View File

@@ -25,11 +25,11 @@ func (v Vector) Update(id ShortID) Vector {
nv[i].ID = id
nv[i].Value = 1
copy(nv[i+1:], v.Counters[i:])
return Vector{nv}
return Vector{Counters: nv}
}
}
// Append a new index
return Vector{append(v.Counters, Counter{id, 1})}
return Vector{Counters: append(v.Counters, Counter{ID: id, Value: 1})}
}
// Merge returns the vector containing the maximum indexes from v and b. If it
@@ -40,7 +40,7 @@ func (v Vector) Merge(b Vector) Vector {
for bi < len(b.Counters) {
if vi == len(v.Counters) {
// We've reach the end of v, all that remains are appends
return Vector{append(v.Counters, b.Counters[bi:]...)}
return Vector{Counters: append(v.Counters, b.Counters[bi:]...)}
}
if v.Counters[vi].ID > b.Counters[bi].ID {
@@ -71,7 +71,7 @@ func (v Vector) Merge(b Vector) Vector {
func (v Vector) Copy() Vector {
nv := make([]Counter, len(v.Counters))
copy(nv, v.Counters)
return Vector{nv}
return Vector{Counters: nv}
}
// Equal returns true when the two vectors are equivalent.