diff --git a/.travis.yml b/.travis.yml index ee77a11..267ce5f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,11 +1,19 @@ language: go go: - - 1.2 + - 1.4 -script: - - go get +install: - go get github.com/stretchr/testify/assert - go get github.com/golang/glog - - go get code.google.com/p/go.tools/cmd/cover - - cd replica - - go test -v -cover + - go get golang.org/x/tools/cmd/cover + - go get github.com/boltdb/bolt/... + - go get github.com/gogo/protobuf/proto + - go get github.com/gogo/protobuf/protoc-gen-gogo + - go get github.com/gogo/protobuf/gogoproto + - go get github.com/gogo/protobuf/protoc-gen-gofast + +script: + - go test -v -cover ./... + +sudo: false + diff --git a/build.sh b/build.sh index f9d773a..478936a 100755 --- a/build.sh +++ b/build.sh @@ -1,5 +1,5 @@ #!/bin/bash go get github.com/stretchr/testify -go get code.google.com/p/leveldb-go/leveldb +go get github.com/boltdb/bolt/... go get github.com/golang/glog diff --git a/demo/server.go b/demo/server.go index 7585a49..f92ec11 100644 --- a/demo/server.go +++ b/demo/server.go @@ -8,9 +8,9 @@ import ( "strconv" "time" - "github.com/go-distributed/epaxos/message" - "github.com/go-distributed/epaxos/replica" - "github.com/go-distributed/epaxos/transporter" + "github.com/sargun/epaxos/message" + "github.com/sargun/epaxos/replica" + "github.com/sargun/epaxos/transporter" "github.com/golang/glog" ) diff --git a/livetest/livereplica_test.go b/livetest/livereplica_test.go index d2df91d..52f9aa0 100644 --- a/livetest/livereplica_test.go +++ b/livetest/livereplica_test.go @@ -7,11 +7,13 @@ import ( "testing" "time" - "github.com/go-distributed/epaxos/message" - "github.com/go-distributed/epaxos/replica" - "github.com/go-distributed/epaxos/test" - "github.com/go-distributed/epaxos/transporter" + "github.com/sargun/epaxos/message" + "github.com/sargun/epaxos/replica" + "github.com/sargun/epaxos/test" + "github.com/sargun/epaxos/transporter" "github.com/stretchr/testify/assert" + "io/ioutil" + "os" ) var _ = fmt.Printf @@ -45,6 +47,7 @@ func livetestlibSetupCluster(clusterSize int) []*replica.Replica { Size: uint8(clusterSize), StateMachine: new(test.DummySM), Transporter: transporter.NewDummyTR(uint8(i), clusterSize), + PersistentPath: tempfile(), } nodes[i], _ = replica.New(param) } @@ -73,6 +76,7 @@ func livetestlibSetupEasyTimeoutCluster(clusterSize int) []*replica.Replica { Size: uint8(clusterSize), StateMachine: new(test.DummySM), Transporter: transporter.NewDummyTR(uint8(i), clusterSize), + PersistentPath: tempfile(), } nodes[i], _ = replica.New(param) } @@ -360,3 +364,12 @@ func Test3ProposerConflictTimeout(t *testing.T) { assert.True(t, liveTestlibVerifyDependency(nodes[0], pos)) } } + + +// Borrowed from: https://github.com/boltdb/bolt/blob/2f4ba1c5331c044ed8c2743b791d5bedf0efa54b/db_test.go#L30-L38 +func tempfile() string { + f, _ := ioutil.TempFile("", "bolt-") + f.Close() + os.Remove(f.Name()) + return f.Name() +} diff --git a/message/ballot_test.go b/message/ballot_test.go index 2cec85f..39cdb08 100644 --- a/message/ballot_test.go +++ b/message/ballot_test.go @@ -117,7 +117,7 @@ func TestBallotClone(t *testing.T) { func TestBallotEpoch(t *testing.T) { b := NewBallot(2, 33, 4) - assert.Equal(t, b.GetEpoch(), uint8(2)) + assert.Equal(t, b.GetEpoch(), uint32(2)) } func TestBallotIsInitialBallot(t *testing.T) { diff --git a/persistent/db.go b/persistent/db.go new file mode 100644 index 0000000..5f13a63 --- /dev/null +++ b/persistent/db.go @@ -0,0 +1,129 @@ +package persistent + +import ( + "os" + "path/filepath" + + "github.com/boltdb/bolt" + "github.com/sargun/epaxos" +) + +var BUCKET_NAME []byte = []byte{'e', 'p', 'a', 'x' , 'o', 's'} +type DB interface { + GetPath() string + Put(key string, value []byte) error + Get(key string) ([]byte, error) + Delete(key string) error + BatchPut(kvs []*epaxos.KVpair) error + Close() error + Drop() error +} +type BoltDB struct { + db *bolt.DB + fpath string +} +/* +type LevelDB struct { + fpath string + ldb *leveldb.DB + wsync *db.WriteOptions +} +*/ + +func NewBoltDB(path string, restore bool) (*BoltDB, error) { + fpath, err := filepath.Abs(path) + if err != nil { + return nil, err + } + + if !restore { + err = os.Remove(fpath) + if err != nil && os.IsExist(err) { + return nil, err + } + } + + db, err := bolt.Open(fpath, 0600, nil) // TODO: tune the option + if err != nil { + return nil, err + } + + err2 := db.Update(func(tx *bolt.Tx) error { + tx.CreateBucketIfNotExists(BUCKET_NAME) + return nil + }) + if err2 != nil { + db.Close() + return nil, err2 + } + + ret := &BoltDB{ + db: db, + fpath: fpath, + } + return ret, nil +} + +func (d *BoltDB) Put(key string, value []byte) error { + err := d.db.Update(func(tx *bolt.Tx) error { + tx.Bucket(BUCKET_NAME).Put([]byte(key), value) + return nil + }) + return err +} +func (d *BoltDB) Get(key string) ([]byte, error) { + var ret []byte + found := false + err := d.db.View(func(tx *bolt.Tx) error { + value := tx.Bucket(BUCKET_NAME).Get([]byte(key)) + if value != nil { + found = true + ret = make([]byte, len(value)) + copy(ret, value) + } + return nil + }) + if found { + return ret, err + } else { + return ret, epaxos.ErrorNotFound + } +} +func (d *BoltDB) Delete(key string) error { + err := d.db.Update(func(tx *bolt.Tx) error { + tx.Bucket(BUCKET_NAME).Delete([]byte(key)) + return nil + }) + return err +} + +func (d *BoltDB) Close() error { + return d.db.Close() +} + +func (d *BoltDB) Drop() error { + err := os.Remove(d.fpath) + if os.IsNotExist(err) { + return nil + } else { + return err + } +} + + +func (d *BoltDB) BatchPut(kvs []*epaxos.KVpair) error { + err := d.db.Update(func(tx *bolt.Tx) error { + bucket := tx.Bucket(BUCKET_NAME) + for i := range kvs { + bucket.Put([]byte(kvs[i].Key), kvs[i].Value) + } + return nil + }) + return err + +} + +func (d *BoltDB) GetPath() string { + + return d.db.Path() +} diff --git a/persistent/leveldb_test.go b/persistent/db_test.go similarity index 79% rename from persistent/leveldb_test.go rename to persistent/db_test.go index 1a5c137..e84667c 100644 --- a/persistent/leveldb_test.go +++ b/persistent/db_test.go @@ -3,13 +3,12 @@ package persistent import ( "testing" - "code.google.com/p/leveldb-go/leveldb/db" - "github.com/go-distributed/epaxos" + "github.com/sargun/epaxos" "github.com/stretchr/testify/assert" ) func TestNewCloseAndDrop(t *testing.T) { - l, err := NewLevelDB("/tmp/test", false) + l, err := NewBoltDB("/tmp/test", false) defer func() { assert.NoError(t, l.Close()) assert.NoError(t, l.Drop()) @@ -17,12 +16,12 @@ func TestNewCloseAndDrop(t *testing.T) { assert.NoError(t, err) assert.NotNil(t, l) - assert.NotNil(t, l.ldb) - assert.Equal(t, l.wsync, &db.WriteOptions{Sync: true}) + assert.NotNil(t, l.db) + assert.Equal(t, l.db.NoSync, false) } func TestPutAndGet(t *testing.T) { - l, err := NewLevelDB("/tmp/test", false) + l, err := NewBoltDB("/tmp/test", false) assert.NoError(t, err) defer func() { @@ -41,7 +40,7 @@ func TestPutAndGet(t *testing.T) { } func TestBatchPut(t *testing.T) { - l, err := NewLevelDB("/tmp/test", false) + l, err := NewBoltDB("/tmp/test", false) assert.NoError(t, err) defer func() { diff --git a/persistent/leveldb.go b/persistent/leveldb.go deleted file mode 100644 index 0cd4e67..0000000 --- a/persistent/leveldb.go +++ /dev/null @@ -1,74 +0,0 @@ -package persistent - -import ( - "os" - "path/filepath" - - "code.google.com/p/leveldb-go/leveldb" - "code.google.com/p/leveldb-go/leveldb/db" - "github.com/go-distributed/epaxos" -) - -type LevelDB struct { - fpath string - ldb *leveldb.DB - wsync *db.WriteOptions -} - -func NewLevelDB(path string, restore bool) (*LevelDB, error) { - fpath, err := filepath.Abs(path) - if err != nil { - return nil, err - } - - if !restore { - err = os.RemoveAll(fpath) - if err != nil { - return nil, err - } - } - - ldb, err := leveldb.Open(fpath, nil) // TODO: tune the option - if err != nil { - return nil, err - } - - ret := &LevelDB{ - fpath: fpath, - ldb: ldb, - wsync: &db.WriteOptions{Sync: true}, - } - return ret, nil -} - -func (l *LevelDB) Put(key string, value []byte) error { - return l.ldb.Set([]byte(key), value, l.wsync) -} - -func (l *LevelDB) Get(key string) ([]byte, error) { - b, err := l.ldb.Get([]byte(key), nil) - if err == db.ErrNotFound { - return b, epaxos.ErrorNotFound - } - return b, err -} - -func (l *LevelDB) Delete(key string) error { - return l.ldb.Delete([]byte(key), l.wsync) -} - -func (l *LevelDB) BatchPut(kvs []*epaxos.KVpair) error { - b := new(leveldb.Batch) - for i := range kvs { - b.Set([]byte(kvs[i].Key), kvs[i].Value) - } - return l.ldb.Apply(*b, l.wsync) -} - -func (l *LevelDB) Close() error { - return l.ldb.Close() -} - -func (l *LevelDB) Drop() error { - return os.RemoveAll(l.fpath) -} diff --git a/protobuf/Makefile b/protobuf/Makefile index 28501a3..276403d 100644 --- a/protobuf/Makefile +++ b/protobuf/Makefile @@ -1,2 +1,9 @@ -all: message.proto - protoc --proto_path=${GOPATH}/src:. --gogo_out=. message.proto +.PHONY: all clean + +all: message.pb.go + +message.pb.go: message.proto + protoc --proto_path=${GOPATH}/src:${GOPATH}/src/github.com/gogo/protobuf/protobuf:. --gogo_out=. *.proto + +clean: + rm -f message.pb.go \ No newline at end of file diff --git a/protobuf/message.pb.go b/protobuf/message.pb.go index ba66a14..13786f2 100644 --- a/protobuf/message.pb.go +++ b/protobuf/message.pb.go @@ -21,32 +21,31 @@ */ package protobuf -import proto "code.google.com/p/gogoprotobuf/proto" -import json "encoding/json" +import proto "github.com/gogo/protobuf/proto" import math "math" -// discarding unused import gogoproto "code.google.com/p/gogoprotobuf/gogoproto/gogo.pb" +// discarding unused import gogoproto "github.com/gogo/protobuf/gogoproto/gogo.pb" import io "io" -import code_google_com_p_gogoprotobuf_proto "code.google.com/p/gogoprotobuf/proto" - import fmt "fmt" +import github_com_gogo_protobuf_proto "github.com/gogo/protobuf/proto" + +import fmt1 "fmt" import strings "strings" import reflect "reflect" -import fmt1 "fmt" +import fmt2 "fmt" import strings1 "strings" -import code_google_com_p_gogoprotobuf_proto1 "code.google.com/p/gogoprotobuf/proto" +import github_com_gogo_protobuf_proto1 "github.com/gogo/protobuf/proto" import sort "sort" import strconv "strconv" import reflect1 "reflect" -import fmt2 "fmt" +import fmt3 "fmt" import bytes "bytes" -// Reference proto, json, and math imports to suppress error if they are not otherwise used. +// Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal -var _ = &json.SyntaxError{} var _ = math.Inf type State int32 @@ -540,7 +539,7 @@ func (m *Ballot) Unmarshal(data []byte) error { switch fieldNum { case 1: if wireType != 0 { - return code_google_com_p_gogoprotobuf_proto.ErrWrongType + return fmt.Errorf("proto: wrong wireType = %d for field Epoch", wireType) } var v uint32 for shift := uint(0); ; shift += 7 { @@ -557,7 +556,7 @@ func (m *Ballot) Unmarshal(data []byte) error { m.Epoch = &v case 2: if wireType != 0 { - return code_google_com_p_gogoprotobuf_proto.ErrWrongType + return fmt.Errorf("proto: wrong wireType = %d for field Number", wireType) } var v uint64 for shift := uint(0); ; shift += 7 { @@ -574,7 +573,7 @@ func (m *Ballot) Unmarshal(data []byte) error { m.Number = &v case 3: if wireType != 0 { - return code_google_com_p_gogoprotobuf_proto.ErrWrongType + return fmt.Errorf("proto: wrong wireType = %d for field ReplicaID", wireType) } var v uint32 for shift := uint(0); ; shift += 7 { @@ -599,7 +598,7 @@ func (m *Ballot) Unmarshal(data []byte) error { } } index -= sizeOfWire - skippy, err := code_google_com_p_gogoprotobuf_proto.Skip(data[index:]) + skippy, err := github_com_gogo_protobuf_proto.Skip(data[index:]) if err != nil { return err } @@ -633,7 +632,7 @@ func (m *PreAccept) Unmarshal(data []byte) error { switch fieldNum { case 1: if wireType != 0 { - return code_google_com_p_gogoprotobuf_proto.ErrWrongType + return fmt.Errorf("proto: wrong wireType = %d for field ReplicaID", wireType) } var v uint32 for shift := uint(0); ; shift += 7 { @@ -650,7 +649,7 @@ func (m *PreAccept) Unmarshal(data []byte) error { m.ReplicaID = &v case 2: if wireType != 0 { - return code_google_com_p_gogoprotobuf_proto.ErrWrongType + return fmt.Errorf("proto: wrong wireType = %d for field InstanceID", wireType) } var v uint64 for shift := uint(0); ; shift += 7 { @@ -667,7 +666,7 @@ func (m *PreAccept) Unmarshal(data []byte) error { m.InstanceID = &v case 3: if wireType != 2 { - return code_google_com_p_gogoprotobuf_proto.ErrWrongType + return fmt.Errorf("proto: wrong wireType = %d for field Cmds", wireType) } var byteLen int for shift := uint(0); ; shift += 7 { @@ -690,7 +689,7 @@ func (m *PreAccept) Unmarshal(data []byte) error { index = postIndex case 4: if wireType != 0 { - return code_google_com_p_gogoprotobuf_proto.ErrWrongType + return fmt.Errorf("proto: wrong wireType = %d for field Deps", wireType) } var v uint64 for shift := uint(0); ; shift += 7 { @@ -707,7 +706,7 @@ func (m *PreAccept) Unmarshal(data []byte) error { m.Deps = append(m.Deps, v) case 5: if wireType != 2 { - return code_google_com_p_gogoprotobuf_proto.ErrWrongType + return fmt.Errorf("proto: wrong wireType = %d for field Ballot", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -734,7 +733,7 @@ func (m *PreAccept) Unmarshal(data []byte) error { index = postIndex case 6: if wireType != 0 { - return code_google_com_p_gogoprotobuf_proto.ErrWrongType + return fmt.Errorf("proto: wrong wireType = %d for field From", wireType) } var v uint32 for shift := uint(0); ; shift += 7 { @@ -759,7 +758,7 @@ func (m *PreAccept) Unmarshal(data []byte) error { } } index -= sizeOfWire - skippy, err := code_google_com_p_gogoprotobuf_proto.Skip(data[index:]) + skippy, err := github_com_gogo_protobuf_proto.Skip(data[index:]) if err != nil { return err } @@ -793,7 +792,7 @@ func (m *PreAcceptOK) Unmarshal(data []byte) error { switch fieldNum { case 1: if wireType != 0 { - return code_google_com_p_gogoprotobuf_proto.ErrWrongType + return fmt.Errorf("proto: wrong wireType = %d for field ReplicaID", wireType) } var v uint32 for shift := uint(0); ; shift += 7 { @@ -810,7 +809,7 @@ func (m *PreAcceptOK) Unmarshal(data []byte) error { m.ReplicaID = &v case 2: if wireType != 0 { - return code_google_com_p_gogoprotobuf_proto.ErrWrongType + return fmt.Errorf("proto: wrong wireType = %d for field InstanceID", wireType) } var v uint64 for shift := uint(0); ; shift += 7 { @@ -827,7 +826,7 @@ func (m *PreAcceptOK) Unmarshal(data []byte) error { m.InstanceID = &v case 3: if wireType != 0 { - return code_google_com_p_gogoprotobuf_proto.ErrWrongType + return fmt.Errorf("proto: wrong wireType = %d for field From", wireType) } var v uint32 for shift := uint(0); ; shift += 7 { @@ -852,7 +851,7 @@ func (m *PreAcceptOK) Unmarshal(data []byte) error { } } index -= sizeOfWire - skippy, err := code_google_com_p_gogoprotobuf_proto.Skip(data[index:]) + skippy, err := github_com_gogo_protobuf_proto.Skip(data[index:]) if err != nil { return err } @@ -886,7 +885,7 @@ func (m *PreAcceptReply) Unmarshal(data []byte) error { switch fieldNum { case 1: if wireType != 0 { - return code_google_com_p_gogoprotobuf_proto.ErrWrongType + return fmt.Errorf("proto: wrong wireType = %d for field ReplicaID", wireType) } var v uint32 for shift := uint(0); ; shift += 7 { @@ -903,7 +902,7 @@ func (m *PreAcceptReply) Unmarshal(data []byte) error { m.ReplicaID = &v case 2: if wireType != 0 { - return code_google_com_p_gogoprotobuf_proto.ErrWrongType + return fmt.Errorf("proto: wrong wireType = %d for field InstanceID", wireType) } var v uint64 for shift := uint(0); ; shift += 7 { @@ -920,7 +919,7 @@ func (m *PreAcceptReply) Unmarshal(data []byte) error { m.InstanceID = &v case 3: if wireType != 0 { - return code_google_com_p_gogoprotobuf_proto.ErrWrongType + return fmt.Errorf("proto: wrong wireType = %d for field Deps", wireType) } var v uint64 for shift := uint(0); ; shift += 7 { @@ -937,7 +936,7 @@ func (m *PreAcceptReply) Unmarshal(data []byte) error { m.Deps = append(m.Deps, v) case 4: if wireType != 2 { - return code_google_com_p_gogoprotobuf_proto.ErrWrongType + return fmt.Errorf("proto: wrong wireType = %d for field Ballot", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -964,7 +963,7 @@ func (m *PreAcceptReply) Unmarshal(data []byte) error { index = postIndex case 5: if wireType != 0 { - return code_google_com_p_gogoprotobuf_proto.ErrWrongType + return fmt.Errorf("proto: wrong wireType = %d for field From", wireType) } var v uint32 for shift := uint(0); ; shift += 7 { @@ -989,7 +988,7 @@ func (m *PreAcceptReply) Unmarshal(data []byte) error { } } index -= sizeOfWire - skippy, err := code_google_com_p_gogoprotobuf_proto.Skip(data[index:]) + skippy, err := github_com_gogo_protobuf_proto.Skip(data[index:]) if err != nil { return err } @@ -1023,7 +1022,7 @@ func (m *Accept) Unmarshal(data []byte) error { switch fieldNum { case 1: if wireType != 0 { - return code_google_com_p_gogoprotobuf_proto.ErrWrongType + return fmt.Errorf("proto: wrong wireType = %d for field ReplicaID", wireType) } var v uint32 for shift := uint(0); ; shift += 7 { @@ -1040,7 +1039,7 @@ func (m *Accept) Unmarshal(data []byte) error { m.ReplicaID = &v case 2: if wireType != 0 { - return code_google_com_p_gogoprotobuf_proto.ErrWrongType + return fmt.Errorf("proto: wrong wireType = %d for field InstanceID", wireType) } var v uint64 for shift := uint(0); ; shift += 7 { @@ -1057,7 +1056,7 @@ func (m *Accept) Unmarshal(data []byte) error { m.InstanceID = &v case 3: if wireType != 2 { - return code_google_com_p_gogoprotobuf_proto.ErrWrongType + return fmt.Errorf("proto: wrong wireType = %d for field Cmds", wireType) } var byteLen int for shift := uint(0); ; shift += 7 { @@ -1080,7 +1079,7 @@ func (m *Accept) Unmarshal(data []byte) error { index = postIndex case 4: if wireType != 0 { - return code_google_com_p_gogoprotobuf_proto.ErrWrongType + return fmt.Errorf("proto: wrong wireType = %d for field Deps", wireType) } var v uint64 for shift := uint(0); ; shift += 7 { @@ -1097,7 +1096,7 @@ func (m *Accept) Unmarshal(data []byte) error { m.Deps = append(m.Deps, v) case 5: if wireType != 2 { - return code_google_com_p_gogoprotobuf_proto.ErrWrongType + return fmt.Errorf("proto: wrong wireType = %d for field Ballot", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -1124,7 +1123,7 @@ func (m *Accept) Unmarshal(data []byte) error { index = postIndex case 6: if wireType != 0 { - return code_google_com_p_gogoprotobuf_proto.ErrWrongType + return fmt.Errorf("proto: wrong wireType = %d for field From", wireType) } var v uint32 for shift := uint(0); ; shift += 7 { @@ -1149,7 +1148,7 @@ func (m *Accept) Unmarshal(data []byte) error { } } index -= sizeOfWire - skippy, err := code_google_com_p_gogoprotobuf_proto.Skip(data[index:]) + skippy, err := github_com_gogo_protobuf_proto.Skip(data[index:]) if err != nil { return err } @@ -1183,7 +1182,7 @@ func (m *AcceptReply) Unmarshal(data []byte) error { switch fieldNum { case 1: if wireType != 0 { - return code_google_com_p_gogoprotobuf_proto.ErrWrongType + return fmt.Errorf("proto: wrong wireType = %d for field ReplicaID", wireType) } var v uint32 for shift := uint(0); ; shift += 7 { @@ -1200,7 +1199,7 @@ func (m *AcceptReply) Unmarshal(data []byte) error { m.ReplicaID = &v case 2: if wireType != 0 { - return code_google_com_p_gogoprotobuf_proto.ErrWrongType + return fmt.Errorf("proto: wrong wireType = %d for field InstanceID", wireType) } var v uint64 for shift := uint(0); ; shift += 7 { @@ -1217,7 +1216,7 @@ func (m *AcceptReply) Unmarshal(data []byte) error { m.InstanceID = &v case 3: if wireType != 2 { - return code_google_com_p_gogoprotobuf_proto.ErrWrongType + return fmt.Errorf("proto: wrong wireType = %d for field Ballot", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -1244,7 +1243,7 @@ func (m *AcceptReply) Unmarshal(data []byte) error { index = postIndex case 4: if wireType != 0 { - return code_google_com_p_gogoprotobuf_proto.ErrWrongType + return fmt.Errorf("proto: wrong wireType = %d for field From", wireType) } var v uint32 for shift := uint(0); ; shift += 7 { @@ -1269,7 +1268,7 @@ func (m *AcceptReply) Unmarshal(data []byte) error { } } index -= sizeOfWire - skippy, err := code_google_com_p_gogoprotobuf_proto.Skip(data[index:]) + skippy, err := github_com_gogo_protobuf_proto.Skip(data[index:]) if err != nil { return err } @@ -1303,7 +1302,7 @@ func (m *Prepare) Unmarshal(data []byte) error { switch fieldNum { case 1: if wireType != 0 { - return code_google_com_p_gogoprotobuf_proto.ErrWrongType + return fmt.Errorf("proto: wrong wireType = %d for field ReplicaID", wireType) } var v uint32 for shift := uint(0); ; shift += 7 { @@ -1320,7 +1319,7 @@ func (m *Prepare) Unmarshal(data []byte) error { m.ReplicaID = &v case 2: if wireType != 0 { - return code_google_com_p_gogoprotobuf_proto.ErrWrongType + return fmt.Errorf("proto: wrong wireType = %d for field InstanceID", wireType) } var v uint64 for shift := uint(0); ; shift += 7 { @@ -1337,7 +1336,7 @@ func (m *Prepare) Unmarshal(data []byte) error { m.InstanceID = &v case 3: if wireType != 2 { - return code_google_com_p_gogoprotobuf_proto.ErrWrongType + return fmt.Errorf("proto: wrong wireType = %d for field Ballot", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -1364,7 +1363,7 @@ func (m *Prepare) Unmarshal(data []byte) error { index = postIndex case 4: if wireType != 0 { - return code_google_com_p_gogoprotobuf_proto.ErrWrongType + return fmt.Errorf("proto: wrong wireType = %d for field From", wireType) } var v uint32 for shift := uint(0); ; shift += 7 { @@ -1389,7 +1388,7 @@ func (m *Prepare) Unmarshal(data []byte) error { } } index -= sizeOfWire - skippy, err := code_google_com_p_gogoprotobuf_proto.Skip(data[index:]) + skippy, err := github_com_gogo_protobuf_proto.Skip(data[index:]) if err != nil { return err } @@ -1423,7 +1422,7 @@ func (m *PrepareReply) Unmarshal(data []byte) error { switch fieldNum { case 1: if wireType != 0 { - return code_google_com_p_gogoprotobuf_proto.ErrWrongType + return fmt.Errorf("proto: wrong wireType = %d for field ReplicaID", wireType) } var v uint32 for shift := uint(0); ; shift += 7 { @@ -1440,7 +1439,7 @@ func (m *PrepareReply) Unmarshal(data []byte) error { m.ReplicaID = &v case 2: if wireType != 0 { - return code_google_com_p_gogoprotobuf_proto.ErrWrongType + return fmt.Errorf("proto: wrong wireType = %d for field InstanceID", wireType) } var v uint64 for shift := uint(0); ; shift += 7 { @@ -1457,7 +1456,7 @@ func (m *PrepareReply) Unmarshal(data []byte) error { m.InstanceID = &v case 3: if wireType != 0 { - return code_google_com_p_gogoprotobuf_proto.ErrWrongType + return fmt.Errorf("proto: wrong wireType = %d for field State", wireType) } var v State for shift := uint(0); ; shift += 7 { @@ -1474,7 +1473,7 @@ func (m *PrepareReply) Unmarshal(data []byte) error { m.State = &v case 4: if wireType != 2 { - return code_google_com_p_gogoprotobuf_proto.ErrWrongType + return fmt.Errorf("proto: wrong wireType = %d for field Cmds", wireType) } var byteLen int for shift := uint(0); ; shift += 7 { @@ -1497,7 +1496,7 @@ func (m *PrepareReply) Unmarshal(data []byte) error { index = postIndex case 5: if wireType != 0 { - return code_google_com_p_gogoprotobuf_proto.ErrWrongType + return fmt.Errorf("proto: wrong wireType = %d for field Deps", wireType) } var v uint64 for shift := uint(0); ; shift += 7 { @@ -1514,7 +1513,7 @@ func (m *PrepareReply) Unmarshal(data []byte) error { m.Deps = append(m.Deps, v) case 6: if wireType != 2 { - return code_google_com_p_gogoprotobuf_proto.ErrWrongType + return fmt.Errorf("proto: wrong wireType = %d for field Ballot", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -1541,7 +1540,7 @@ func (m *PrepareReply) Unmarshal(data []byte) error { index = postIndex case 7: if wireType != 2 { - return code_google_com_p_gogoprotobuf_proto.ErrWrongType + return fmt.Errorf("proto: wrong wireType = %d for field OriginalBallot", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -1568,7 +1567,7 @@ func (m *PrepareReply) Unmarshal(data []byte) error { index = postIndex case 8: if wireType != 0 { - return code_google_com_p_gogoprotobuf_proto.ErrWrongType + return fmt.Errorf("proto: wrong wireType = %d for field IsFromLeader", wireType) } var v int for shift := uint(0); ; shift += 7 { @@ -1586,7 +1585,7 @@ func (m *PrepareReply) Unmarshal(data []byte) error { m.IsFromLeader = &b case 9: if wireType != 0 { - return code_google_com_p_gogoprotobuf_proto.ErrWrongType + return fmt.Errorf("proto: wrong wireType = %d for field From", wireType) } var v uint32 for shift := uint(0); ; shift += 7 { @@ -1611,7 +1610,7 @@ func (m *PrepareReply) Unmarshal(data []byte) error { } } index -= sizeOfWire - skippy, err := code_google_com_p_gogoprotobuf_proto.Skip(data[index:]) + skippy, err := github_com_gogo_protobuf_proto.Skip(data[index:]) if err != nil { return err } @@ -1645,7 +1644,7 @@ func (m *Commit) Unmarshal(data []byte) error { switch fieldNum { case 1: if wireType != 0 { - return code_google_com_p_gogoprotobuf_proto.ErrWrongType + return fmt.Errorf("proto: wrong wireType = %d for field ReplicaID", wireType) } var v uint32 for shift := uint(0); ; shift += 7 { @@ -1662,7 +1661,7 @@ func (m *Commit) Unmarshal(data []byte) error { m.ReplicaID = &v case 2: if wireType != 0 { - return code_google_com_p_gogoprotobuf_proto.ErrWrongType + return fmt.Errorf("proto: wrong wireType = %d for field InstancdID", wireType) } var v uint64 for shift := uint(0); ; shift += 7 { @@ -1679,7 +1678,7 @@ func (m *Commit) Unmarshal(data []byte) error { m.InstancdID = &v case 3: if wireType != 2 { - return code_google_com_p_gogoprotobuf_proto.ErrWrongType + return fmt.Errorf("proto: wrong wireType = %d for field Cmds", wireType) } var byteLen int for shift := uint(0); ; shift += 7 { @@ -1702,7 +1701,7 @@ func (m *Commit) Unmarshal(data []byte) error { index = postIndex case 4: if wireType != 0 { - return code_google_com_p_gogoprotobuf_proto.ErrWrongType + return fmt.Errorf("proto: wrong wireType = %d for field Deps", wireType) } var v uint64 for shift := uint(0); ; shift += 7 { @@ -1719,7 +1718,7 @@ func (m *Commit) Unmarshal(data []byte) error { m.Deps = append(m.Deps, v) case 5: if wireType != 0 { - return code_google_com_p_gogoprotobuf_proto.ErrWrongType + return fmt.Errorf("proto: wrong wireType = %d for field From", wireType) } var v uint32 for shift := uint(0); ; shift += 7 { @@ -1744,7 +1743,7 @@ func (m *Commit) Unmarshal(data []byte) error { } } index -= sizeOfWire - skippy, err := code_google_com_p_gogoprotobuf_proto.Skip(data[index:]) + skippy, err := github_com_gogo_protobuf_proto.Skip(data[index:]) if err != nil { return err } @@ -1765,7 +1764,7 @@ func (this *Ballot) String() string { `Epoch:` + valueToStringMessage(this.Epoch) + `,`, `Number:` + valueToStringMessage(this.Number) + `,`, `ReplicaID:` + valueToStringMessage(this.ReplicaID) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `XXX_unrecognized:` + fmt1.Sprintf("%v", this.XXX_unrecognized) + `,`, `}`, }, "") return s @@ -1777,11 +1776,11 @@ func (this *PreAccept) String() string { s := strings.Join([]string{`&PreAccept{`, `ReplicaID:` + valueToStringMessage(this.ReplicaID) + `,`, `InstanceID:` + valueToStringMessage(this.InstanceID) + `,`, - `Cmds:` + fmt.Sprintf("%v", this.Cmds) + `,`, - `Deps:` + fmt.Sprintf("%v", this.Deps) + `,`, - `Ballot:` + strings.Replace(fmt.Sprintf("%v", this.Ballot), "Ballot", "Ballot", 1) + `,`, + `Cmds:` + fmt1.Sprintf("%v", this.Cmds) + `,`, + `Deps:` + fmt1.Sprintf("%v", this.Deps) + `,`, + `Ballot:` + strings.Replace(fmt1.Sprintf("%v", this.Ballot), "Ballot", "Ballot", 1) + `,`, `From:` + valueToStringMessage(this.From) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `XXX_unrecognized:` + fmt1.Sprintf("%v", this.XXX_unrecognized) + `,`, `}`, }, "") return s @@ -1794,7 +1793,7 @@ func (this *PreAcceptOK) String() string { `ReplicaID:` + valueToStringMessage(this.ReplicaID) + `,`, `InstanceID:` + valueToStringMessage(this.InstanceID) + `,`, `From:` + valueToStringMessage(this.From) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `XXX_unrecognized:` + fmt1.Sprintf("%v", this.XXX_unrecognized) + `,`, `}`, }, "") return s @@ -1806,10 +1805,10 @@ func (this *PreAcceptReply) String() string { s := strings.Join([]string{`&PreAcceptReply{`, `ReplicaID:` + valueToStringMessage(this.ReplicaID) + `,`, `InstanceID:` + valueToStringMessage(this.InstanceID) + `,`, - `Deps:` + fmt.Sprintf("%v", this.Deps) + `,`, - `Ballot:` + strings.Replace(fmt.Sprintf("%v", this.Ballot), "Ballot", "Ballot", 1) + `,`, + `Deps:` + fmt1.Sprintf("%v", this.Deps) + `,`, + `Ballot:` + strings.Replace(fmt1.Sprintf("%v", this.Ballot), "Ballot", "Ballot", 1) + `,`, `From:` + valueToStringMessage(this.From) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `XXX_unrecognized:` + fmt1.Sprintf("%v", this.XXX_unrecognized) + `,`, `}`, }, "") return s @@ -1821,11 +1820,11 @@ func (this *Accept) String() string { s := strings.Join([]string{`&Accept{`, `ReplicaID:` + valueToStringMessage(this.ReplicaID) + `,`, `InstanceID:` + valueToStringMessage(this.InstanceID) + `,`, - `Cmds:` + fmt.Sprintf("%v", this.Cmds) + `,`, - `Deps:` + fmt.Sprintf("%v", this.Deps) + `,`, - `Ballot:` + strings.Replace(fmt.Sprintf("%v", this.Ballot), "Ballot", "Ballot", 1) + `,`, + `Cmds:` + fmt1.Sprintf("%v", this.Cmds) + `,`, + `Deps:` + fmt1.Sprintf("%v", this.Deps) + `,`, + `Ballot:` + strings.Replace(fmt1.Sprintf("%v", this.Ballot), "Ballot", "Ballot", 1) + `,`, `From:` + valueToStringMessage(this.From) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `XXX_unrecognized:` + fmt1.Sprintf("%v", this.XXX_unrecognized) + `,`, `}`, }, "") return s @@ -1837,9 +1836,9 @@ func (this *AcceptReply) String() string { s := strings.Join([]string{`&AcceptReply{`, `ReplicaID:` + valueToStringMessage(this.ReplicaID) + `,`, `InstanceID:` + valueToStringMessage(this.InstanceID) + `,`, - `Ballot:` + strings.Replace(fmt.Sprintf("%v", this.Ballot), "Ballot", "Ballot", 1) + `,`, + `Ballot:` + strings.Replace(fmt1.Sprintf("%v", this.Ballot), "Ballot", "Ballot", 1) + `,`, `From:` + valueToStringMessage(this.From) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `XXX_unrecognized:` + fmt1.Sprintf("%v", this.XXX_unrecognized) + `,`, `}`, }, "") return s @@ -1851,9 +1850,9 @@ func (this *Prepare) String() string { s := strings.Join([]string{`&Prepare{`, `ReplicaID:` + valueToStringMessage(this.ReplicaID) + `,`, `InstanceID:` + valueToStringMessage(this.InstanceID) + `,`, - `Ballot:` + strings.Replace(fmt.Sprintf("%v", this.Ballot), "Ballot", "Ballot", 1) + `,`, + `Ballot:` + strings.Replace(fmt1.Sprintf("%v", this.Ballot), "Ballot", "Ballot", 1) + `,`, `From:` + valueToStringMessage(this.From) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `XXX_unrecognized:` + fmt1.Sprintf("%v", this.XXX_unrecognized) + `,`, `}`, }, "") return s @@ -1866,13 +1865,13 @@ func (this *PrepareReply) String() string { `ReplicaID:` + valueToStringMessage(this.ReplicaID) + `,`, `InstanceID:` + valueToStringMessage(this.InstanceID) + `,`, `State:` + valueToStringMessage(this.State) + `,`, - `Cmds:` + fmt.Sprintf("%v", this.Cmds) + `,`, - `Deps:` + fmt.Sprintf("%v", this.Deps) + `,`, - `Ballot:` + strings.Replace(fmt.Sprintf("%v", this.Ballot), "Ballot", "Ballot", 1) + `,`, - `OriginalBallot:` + strings.Replace(fmt.Sprintf("%v", this.OriginalBallot), "Ballot", "Ballot", 1) + `,`, + `Cmds:` + fmt1.Sprintf("%v", this.Cmds) + `,`, + `Deps:` + fmt1.Sprintf("%v", this.Deps) + `,`, + `Ballot:` + strings.Replace(fmt1.Sprintf("%v", this.Ballot), "Ballot", "Ballot", 1) + `,`, + `OriginalBallot:` + strings.Replace(fmt1.Sprintf("%v", this.OriginalBallot), "Ballot", "Ballot", 1) + `,`, `IsFromLeader:` + valueToStringMessage(this.IsFromLeader) + `,`, `From:` + valueToStringMessage(this.From) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `XXX_unrecognized:` + fmt1.Sprintf("%v", this.XXX_unrecognized) + `,`, `}`, }, "") return s @@ -1884,10 +1883,10 @@ func (this *Commit) String() string { s := strings.Join([]string{`&Commit{`, `ReplicaID:` + valueToStringMessage(this.ReplicaID) + `,`, `InstancdID:` + valueToStringMessage(this.InstancdID) + `,`, - `Cmds:` + fmt.Sprintf("%v", this.Cmds) + `,`, - `Deps:` + fmt.Sprintf("%v", this.Deps) + `,`, + `Cmds:` + fmt1.Sprintf("%v", this.Cmds) + `,`, + `Deps:` + fmt1.Sprintf("%v", this.Deps) + `,`, `From:` + valueToStringMessage(this.From) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `XXX_unrecognized:` + fmt1.Sprintf("%v", this.XXX_unrecognized) + `,`, `}`, }, "") return s @@ -1898,7 +1897,7 @@ func valueToStringMessage(v interface{}) string { return "nil" } pv := reflect.Indirect(rv).Interface() - return fmt.Sprintf("*%v", pv) + return fmt1.Sprintf("*%v", pv) } func (m *Ballot) Size() (n int) { var l int @@ -1917,6 +1916,7 @@ func (m *Ballot) Size() (n int) { } return n } + func (m *PreAccept) Size() (n int) { var l int _ = l @@ -1949,6 +1949,7 @@ func (m *PreAccept) Size() (n int) { } return n } + func (m *PreAcceptOK) Size() (n int) { var l int _ = l @@ -1966,6 +1967,7 @@ func (m *PreAcceptOK) Size() (n int) { } return n } + func (m *PreAcceptReply) Size() (n int) { var l int _ = l @@ -1992,6 +1994,7 @@ func (m *PreAcceptReply) Size() (n int) { } return n } + func (m *Accept) Size() (n int) { var l int _ = l @@ -2024,6 +2027,7 @@ func (m *Accept) Size() (n int) { } return n } + func (m *AcceptReply) Size() (n int) { var l int _ = l @@ -2045,6 +2049,7 @@ func (m *AcceptReply) Size() (n int) { } return n } + func (m *Prepare) Size() (n int) { var l int _ = l @@ -2066,6 +2071,7 @@ func (m *Prepare) Size() (n int) { } return n } + func (m *PrepareReply) Size() (n int) { var l int _ = l @@ -2108,6 +2114,7 @@ func (m *PrepareReply) Size() (n int) { } return n } + func (m *Commit) Size() (n int) { var l int _ = l @@ -2407,7 +2414,11 @@ func randFieldMessage(data []byte, r randyMessage, fieldNumber int, wire int) [] switch wire { case 0: data = encodeVarintPopulateMessage(data, uint64(key)) - data = encodeVarintPopulateMessage(data, uint64(r.Int63())) + v44 := r.Int63() + if r.Intn(2) == 0 { + v44 *= -1 + } + data = encodeVarintPopulateMessage(data, uint64(v44)) case 1: data = encodeVarintPopulateMessage(data, uint64(key)) data = append(data, byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256))) @@ -2467,6 +2478,7 @@ func (m *Ballot) MarshalTo(data []byte) (n int, err error) { } return i, nil } + func (m *PreAccept) Marshal() (data []byte, err error) { size := m.Size() data = make([]byte, size) @@ -2504,13 +2516,7 @@ func (m *PreAccept) MarshalTo(data []byte) (n int, err error) { for _, num := range m.Deps { data[i] = 0x20 i++ - for num >= 1<<7 { - data[i] = uint8(uint64(num)&0x7f | 0x80) - num >>= 7 - i++ - } - data[i] = uint8(num) - i++ + i = encodeVarintMessage(data, i, uint64(num)) } } if m.Ballot != nil { @@ -2533,6 +2539,7 @@ func (m *PreAccept) MarshalTo(data []byte) (n int, err error) { } return i, nil } + func (m *PreAcceptOK) Marshal() (data []byte, err error) { size := m.Size() data = make([]byte, size) @@ -2568,6 +2575,7 @@ func (m *PreAcceptOK) MarshalTo(data []byte) (n int, err error) { } return i, nil } + func (m *PreAcceptReply) Marshal() (data []byte, err error) { size := m.Size() data = make([]byte, size) @@ -2597,13 +2605,7 @@ func (m *PreAcceptReply) MarshalTo(data []byte) (n int, err error) { for _, num := range m.Deps { data[i] = 0x18 i++ - for num >= 1<<7 { - data[i] = uint8(uint64(num)&0x7f | 0x80) - num >>= 7 - i++ - } - data[i] = uint8(num) - i++ + i = encodeVarintMessage(data, i, uint64(num)) } } if m.Ballot != nil { @@ -2626,6 +2628,7 @@ func (m *PreAcceptReply) MarshalTo(data []byte) (n int, err error) { } return i, nil } + func (m *Accept) Marshal() (data []byte, err error) { size := m.Size() data = make([]byte, size) @@ -2663,13 +2666,7 @@ func (m *Accept) MarshalTo(data []byte) (n int, err error) { for _, num := range m.Deps { data[i] = 0x20 i++ - for num >= 1<<7 { - data[i] = uint8(uint64(num)&0x7f | 0x80) - num >>= 7 - i++ - } - data[i] = uint8(num) - i++ + i = encodeVarintMessage(data, i, uint64(num)) } } if m.Ballot != nil { @@ -2692,6 +2689,7 @@ func (m *Accept) MarshalTo(data []byte) (n int, err error) { } return i, nil } + func (m *AcceptReply) Marshal() (data []byte, err error) { size := m.Size() data = make([]byte, size) @@ -2737,6 +2735,7 @@ func (m *AcceptReply) MarshalTo(data []byte) (n int, err error) { } return i, nil } + func (m *Prepare) Marshal() (data []byte, err error) { size := m.Size() data = make([]byte, size) @@ -2782,6 +2781,7 @@ func (m *Prepare) MarshalTo(data []byte) (n int, err error) { } return i, nil } + func (m *PrepareReply) Marshal() (data []byte, err error) { size := m.Size() data = make([]byte, size) @@ -2824,13 +2824,7 @@ func (m *PrepareReply) MarshalTo(data []byte) (n int, err error) { for _, num := range m.Deps { data[i] = 0x28 i++ - for num >= 1<<7 { - data[i] = uint8(uint64(num)&0x7f | 0x80) - num >>= 7 - i++ - } - data[i] = uint8(num) - i++ + i = encodeVarintMessage(data, i, uint64(num)) } } if m.Ballot != nil { @@ -2873,6 +2867,7 @@ func (m *PrepareReply) MarshalTo(data []byte) (n int, err error) { } return i, nil } + func (m *Commit) Marshal() (data []byte, err error) { size := m.Size() data = make([]byte, size) @@ -2910,13 +2905,7 @@ func (m *Commit) MarshalTo(data []byte) (n int, err error) { for _, num := range m.Deps { data[i] = 0x20 i++ - for num >= 1<<7 { - data[i] = uint8(uint64(num)&0x7f | 0x80) - num >>= 7 - i++ - } - data[i] = uint8(num) - i++ + i = encodeVarintMessage(data, i, uint64(num)) } } if m.From != nil { @@ -2929,6 +2918,7 @@ func (m *Commit) MarshalTo(data []byte) (n int, err error) { } return i, nil } + func encodeFixed64Message(data []byte, offset int, v uint64) int { data[offset] = uint8(v) data[offset+1] = uint8(v >> 8) @@ -2960,63 +2950,117 @@ func (this *Ballot) GoString() string { if this == nil { return "nil" } - s := strings1.Join([]string{`&protobuf.Ballot{` + `Epoch:` + valueToGoStringMessage(this.Epoch, "uint32"), `Number:` + valueToGoStringMessage(this.Number, "uint64"), `ReplicaID:` + valueToGoStringMessage(this.ReplicaID, "uint32"), `XXX_unrecognized:` + fmt1.Sprintf("%#v", this.XXX_unrecognized) + `}`}, ", ") + s := strings1.Join([]string{`&protobuf.Ballot{` + + `Epoch:` + valueToGoStringMessage(this.Epoch, "uint32"), + `Number:` + valueToGoStringMessage(this.Number, "uint64"), + `ReplicaID:` + valueToGoStringMessage(this.ReplicaID, "uint32"), + `XXX_unrecognized:` + fmt2.Sprintf("%#v", this.XXX_unrecognized) + `}`}, ", ") return s } func (this *PreAccept) GoString() string { if this == nil { return "nil" } - s := strings1.Join([]string{`&protobuf.PreAccept{` + `ReplicaID:` + valueToGoStringMessage(this.ReplicaID, "uint32"), `InstanceID:` + valueToGoStringMessage(this.InstanceID, "uint64"), `Cmds:` + fmt1.Sprintf("%#v", this.Cmds), `Deps:` + fmt1.Sprintf("%#v", this.Deps), `Ballot:` + fmt1.Sprintf("%#v", this.Ballot), `From:` + valueToGoStringMessage(this.From, "uint32"), `XXX_unrecognized:` + fmt1.Sprintf("%#v", this.XXX_unrecognized) + `}`}, ", ") + s := strings1.Join([]string{`&protobuf.PreAccept{` + + `ReplicaID:` + valueToGoStringMessage(this.ReplicaID, "uint32"), + `InstanceID:` + valueToGoStringMessage(this.InstanceID, "uint64"), + `Cmds:` + fmt2.Sprintf("%#v", this.Cmds), + `Deps:` + fmt2.Sprintf("%#v", this.Deps), + `Ballot:` + fmt2.Sprintf("%#v", this.Ballot), + `From:` + valueToGoStringMessage(this.From, "uint32"), + `XXX_unrecognized:` + fmt2.Sprintf("%#v", this.XXX_unrecognized) + `}`}, ", ") return s } func (this *PreAcceptOK) GoString() string { if this == nil { return "nil" } - s := strings1.Join([]string{`&protobuf.PreAcceptOK{` + `ReplicaID:` + valueToGoStringMessage(this.ReplicaID, "uint32"), `InstanceID:` + valueToGoStringMessage(this.InstanceID, "uint64"), `From:` + valueToGoStringMessage(this.From, "uint32"), `XXX_unrecognized:` + fmt1.Sprintf("%#v", this.XXX_unrecognized) + `}`}, ", ") + s := strings1.Join([]string{`&protobuf.PreAcceptOK{` + + `ReplicaID:` + valueToGoStringMessage(this.ReplicaID, "uint32"), + `InstanceID:` + valueToGoStringMessage(this.InstanceID, "uint64"), + `From:` + valueToGoStringMessage(this.From, "uint32"), + `XXX_unrecognized:` + fmt2.Sprintf("%#v", this.XXX_unrecognized) + `}`}, ", ") return s } func (this *PreAcceptReply) GoString() string { if this == nil { return "nil" } - s := strings1.Join([]string{`&protobuf.PreAcceptReply{` + `ReplicaID:` + valueToGoStringMessage(this.ReplicaID, "uint32"), `InstanceID:` + valueToGoStringMessage(this.InstanceID, "uint64"), `Deps:` + fmt1.Sprintf("%#v", this.Deps), `Ballot:` + fmt1.Sprintf("%#v", this.Ballot), `From:` + valueToGoStringMessage(this.From, "uint32"), `XXX_unrecognized:` + fmt1.Sprintf("%#v", this.XXX_unrecognized) + `}`}, ", ") + s := strings1.Join([]string{`&protobuf.PreAcceptReply{` + + `ReplicaID:` + valueToGoStringMessage(this.ReplicaID, "uint32"), + `InstanceID:` + valueToGoStringMessage(this.InstanceID, "uint64"), + `Deps:` + fmt2.Sprintf("%#v", this.Deps), + `Ballot:` + fmt2.Sprintf("%#v", this.Ballot), + `From:` + valueToGoStringMessage(this.From, "uint32"), + `XXX_unrecognized:` + fmt2.Sprintf("%#v", this.XXX_unrecognized) + `}`}, ", ") return s } func (this *Accept) GoString() string { if this == nil { return "nil" } - s := strings1.Join([]string{`&protobuf.Accept{` + `ReplicaID:` + valueToGoStringMessage(this.ReplicaID, "uint32"), `InstanceID:` + valueToGoStringMessage(this.InstanceID, "uint64"), `Cmds:` + fmt1.Sprintf("%#v", this.Cmds), `Deps:` + fmt1.Sprintf("%#v", this.Deps), `Ballot:` + fmt1.Sprintf("%#v", this.Ballot), `From:` + valueToGoStringMessage(this.From, "uint32"), `XXX_unrecognized:` + fmt1.Sprintf("%#v", this.XXX_unrecognized) + `}`}, ", ") + s := strings1.Join([]string{`&protobuf.Accept{` + + `ReplicaID:` + valueToGoStringMessage(this.ReplicaID, "uint32"), + `InstanceID:` + valueToGoStringMessage(this.InstanceID, "uint64"), + `Cmds:` + fmt2.Sprintf("%#v", this.Cmds), + `Deps:` + fmt2.Sprintf("%#v", this.Deps), + `Ballot:` + fmt2.Sprintf("%#v", this.Ballot), + `From:` + valueToGoStringMessage(this.From, "uint32"), + `XXX_unrecognized:` + fmt2.Sprintf("%#v", this.XXX_unrecognized) + `}`}, ", ") return s } func (this *AcceptReply) GoString() string { if this == nil { return "nil" } - s := strings1.Join([]string{`&protobuf.AcceptReply{` + `ReplicaID:` + valueToGoStringMessage(this.ReplicaID, "uint32"), `InstanceID:` + valueToGoStringMessage(this.InstanceID, "uint64"), `Ballot:` + fmt1.Sprintf("%#v", this.Ballot), `From:` + valueToGoStringMessage(this.From, "uint32"), `XXX_unrecognized:` + fmt1.Sprintf("%#v", this.XXX_unrecognized) + `}`}, ", ") + s := strings1.Join([]string{`&protobuf.AcceptReply{` + + `ReplicaID:` + valueToGoStringMessage(this.ReplicaID, "uint32"), + `InstanceID:` + valueToGoStringMessage(this.InstanceID, "uint64"), + `Ballot:` + fmt2.Sprintf("%#v", this.Ballot), + `From:` + valueToGoStringMessage(this.From, "uint32"), + `XXX_unrecognized:` + fmt2.Sprintf("%#v", this.XXX_unrecognized) + `}`}, ", ") return s } func (this *Prepare) GoString() string { if this == nil { return "nil" } - s := strings1.Join([]string{`&protobuf.Prepare{` + `ReplicaID:` + valueToGoStringMessage(this.ReplicaID, "uint32"), `InstanceID:` + valueToGoStringMessage(this.InstanceID, "uint64"), `Ballot:` + fmt1.Sprintf("%#v", this.Ballot), `From:` + valueToGoStringMessage(this.From, "uint32"), `XXX_unrecognized:` + fmt1.Sprintf("%#v", this.XXX_unrecognized) + `}`}, ", ") + s := strings1.Join([]string{`&protobuf.Prepare{` + + `ReplicaID:` + valueToGoStringMessage(this.ReplicaID, "uint32"), + `InstanceID:` + valueToGoStringMessage(this.InstanceID, "uint64"), + `Ballot:` + fmt2.Sprintf("%#v", this.Ballot), + `From:` + valueToGoStringMessage(this.From, "uint32"), + `XXX_unrecognized:` + fmt2.Sprintf("%#v", this.XXX_unrecognized) + `}`}, ", ") return s } func (this *PrepareReply) GoString() string { if this == nil { return "nil" } - s := strings1.Join([]string{`&protobuf.PrepareReply{` + `ReplicaID:` + valueToGoStringMessage(this.ReplicaID, "uint32"), `InstanceID:` + valueToGoStringMessage(this.InstanceID, "uint64"), `State:` + valueToGoStringMessage(this.State, "protobuf.State"), `Cmds:` + fmt1.Sprintf("%#v", this.Cmds), `Deps:` + fmt1.Sprintf("%#v", this.Deps), `Ballot:` + fmt1.Sprintf("%#v", this.Ballot), `OriginalBallot:` + fmt1.Sprintf("%#v", this.OriginalBallot), `IsFromLeader:` + valueToGoStringMessage(this.IsFromLeader, "bool"), `From:` + valueToGoStringMessage(this.From, "uint32"), `XXX_unrecognized:` + fmt1.Sprintf("%#v", this.XXX_unrecognized) + `}`}, ", ") + s := strings1.Join([]string{`&protobuf.PrepareReply{` + + `ReplicaID:` + valueToGoStringMessage(this.ReplicaID, "uint32"), + `InstanceID:` + valueToGoStringMessage(this.InstanceID, "uint64"), + `State:` + valueToGoStringMessage(this.State, "protobuf.State"), + `Cmds:` + fmt2.Sprintf("%#v", this.Cmds), + `Deps:` + fmt2.Sprintf("%#v", this.Deps), + `Ballot:` + fmt2.Sprintf("%#v", this.Ballot), + `OriginalBallot:` + fmt2.Sprintf("%#v", this.OriginalBallot), + `IsFromLeader:` + valueToGoStringMessage(this.IsFromLeader, "bool"), + `From:` + valueToGoStringMessage(this.From, "uint32"), + `XXX_unrecognized:` + fmt2.Sprintf("%#v", this.XXX_unrecognized) + `}`}, ", ") return s } func (this *Commit) GoString() string { if this == nil { return "nil" } - s := strings1.Join([]string{`&protobuf.Commit{` + `ReplicaID:` + valueToGoStringMessage(this.ReplicaID, "uint32"), `InstancdID:` + valueToGoStringMessage(this.InstancdID, "uint64"), `Cmds:` + fmt1.Sprintf("%#v", this.Cmds), `Deps:` + fmt1.Sprintf("%#v", this.Deps), `From:` + valueToGoStringMessage(this.From, "uint32"), `XXX_unrecognized:` + fmt1.Sprintf("%#v", this.XXX_unrecognized) + `}`}, ", ") + s := strings1.Join([]string{`&protobuf.Commit{` + + `ReplicaID:` + valueToGoStringMessage(this.ReplicaID, "uint32"), + `InstancdID:` + valueToGoStringMessage(this.InstancdID, "uint64"), + `Cmds:` + fmt2.Sprintf("%#v", this.Cmds), + `Deps:` + fmt2.Sprintf("%#v", this.Deps), + `From:` + valueToGoStringMessage(this.From, "uint32"), + `XXX_unrecognized:` + fmt2.Sprintf("%#v", this.XXX_unrecognized) + `}`}, ", ") return s } func valueToGoStringMessage(v interface{}, typ string) string { @@ -3025,9 +3069,9 @@ func valueToGoStringMessage(v interface{}, typ string) string { return "nil" } pv := reflect1.Indirect(rv).Interface() - return fmt1.Sprintf("func(v %v) *%v { return &v } ( %#v )", typ, typ, pv) + return fmt2.Sprintf("func(v %v) *%v { return &v } ( %#v )", typ, typ, pv) } -func extensionToGoStringMessage(e map[int32]code_google_com_p_gogoprotobuf_proto1.Extension) string { +func extensionToGoStringMessage(e map[int32]github_com_gogo_protobuf_proto1.Extension) string { if e == nil { return "nil" } @@ -3049,50 +3093,50 @@ func (this *Ballot) VerboseEqual(that interface{}) error { if this == nil { return nil } - return fmt2.Errorf("that == nil && this != nil") + return fmt3.Errorf("that == nil && this != nil") } that1, ok := that.(*Ballot) if !ok { - return fmt2.Errorf("that is not of type *Ballot") + return fmt3.Errorf("that is not of type *Ballot") } if that1 == nil { if this == nil { return nil } - return fmt2.Errorf("that is type *Ballot but is nil && this != nil") + return fmt3.Errorf("that is type *Ballot but is nil && this != nil") } else if this == nil { - return fmt2.Errorf("that is type *Ballotbut is not nil && this == nil") + return fmt3.Errorf("that is type *Ballotbut is not nil && this == nil") } if this.Epoch != nil && that1.Epoch != nil { if *this.Epoch != *that1.Epoch { - return fmt2.Errorf("Epoch this(%v) Not Equal that(%v)", *this.Epoch, *that1.Epoch) + return fmt3.Errorf("Epoch this(%v) Not Equal that(%v)", *this.Epoch, *that1.Epoch) } } else if this.Epoch != nil { - return fmt2.Errorf("this.Epoch == nil && that.Epoch != nil") + return fmt3.Errorf("this.Epoch == nil && that.Epoch != nil") } else if that1.Epoch != nil { - return fmt2.Errorf("Epoch this(%v) Not Equal that(%v)", this.Epoch, that1.Epoch) + return fmt3.Errorf("Epoch this(%v) Not Equal that(%v)", this.Epoch, that1.Epoch) } if this.Number != nil && that1.Number != nil { if *this.Number != *that1.Number { - return fmt2.Errorf("Number this(%v) Not Equal that(%v)", *this.Number, *that1.Number) + return fmt3.Errorf("Number this(%v) Not Equal that(%v)", *this.Number, *that1.Number) } } else if this.Number != nil { - return fmt2.Errorf("this.Number == nil && that.Number != nil") + return fmt3.Errorf("this.Number == nil && that.Number != nil") } else if that1.Number != nil { - return fmt2.Errorf("Number this(%v) Not Equal that(%v)", this.Number, that1.Number) + return fmt3.Errorf("Number this(%v) Not Equal that(%v)", this.Number, that1.Number) } if this.ReplicaID != nil && that1.ReplicaID != nil { if *this.ReplicaID != *that1.ReplicaID { - return fmt2.Errorf("ReplicaID this(%v) Not Equal that(%v)", *this.ReplicaID, *that1.ReplicaID) + return fmt3.Errorf("ReplicaID this(%v) Not Equal that(%v)", *this.ReplicaID, *that1.ReplicaID) } } else if this.ReplicaID != nil { - return fmt2.Errorf("this.ReplicaID == nil && that.ReplicaID != nil") + return fmt3.Errorf("this.ReplicaID == nil && that.ReplicaID != nil") } else if that1.ReplicaID != nil { - return fmt2.Errorf("ReplicaID this(%v) Not Equal that(%v)", this.ReplicaID, that1.ReplicaID) + return fmt3.Errorf("ReplicaID this(%v) Not Equal that(%v)", this.ReplicaID, that1.ReplicaID) } if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt2.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) + return fmt3.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) } return nil } @@ -3153,69 +3197,69 @@ func (this *PreAccept) VerboseEqual(that interface{}) error { if this == nil { return nil } - return fmt2.Errorf("that == nil && this != nil") + return fmt3.Errorf("that == nil && this != nil") } that1, ok := that.(*PreAccept) if !ok { - return fmt2.Errorf("that is not of type *PreAccept") + return fmt3.Errorf("that is not of type *PreAccept") } if that1 == nil { if this == nil { return nil } - return fmt2.Errorf("that is type *PreAccept but is nil && this != nil") + return fmt3.Errorf("that is type *PreAccept but is nil && this != nil") } else if this == nil { - return fmt2.Errorf("that is type *PreAcceptbut is not nil && this == nil") + return fmt3.Errorf("that is type *PreAcceptbut is not nil && this == nil") } if this.ReplicaID != nil && that1.ReplicaID != nil { if *this.ReplicaID != *that1.ReplicaID { - return fmt2.Errorf("ReplicaID this(%v) Not Equal that(%v)", *this.ReplicaID, *that1.ReplicaID) + return fmt3.Errorf("ReplicaID this(%v) Not Equal that(%v)", *this.ReplicaID, *that1.ReplicaID) } } else if this.ReplicaID != nil { - return fmt2.Errorf("this.ReplicaID == nil && that.ReplicaID != nil") + return fmt3.Errorf("this.ReplicaID == nil && that.ReplicaID != nil") } else if that1.ReplicaID != nil { - return fmt2.Errorf("ReplicaID this(%v) Not Equal that(%v)", this.ReplicaID, that1.ReplicaID) + return fmt3.Errorf("ReplicaID this(%v) Not Equal that(%v)", this.ReplicaID, that1.ReplicaID) } if this.InstanceID != nil && that1.InstanceID != nil { if *this.InstanceID != *that1.InstanceID { - return fmt2.Errorf("InstanceID this(%v) Not Equal that(%v)", *this.InstanceID, *that1.InstanceID) + return fmt3.Errorf("InstanceID this(%v) Not Equal that(%v)", *this.InstanceID, *that1.InstanceID) } } else if this.InstanceID != nil { - return fmt2.Errorf("this.InstanceID == nil && that.InstanceID != nil") + return fmt3.Errorf("this.InstanceID == nil && that.InstanceID != nil") } else if that1.InstanceID != nil { - return fmt2.Errorf("InstanceID this(%v) Not Equal that(%v)", this.InstanceID, that1.InstanceID) + return fmt3.Errorf("InstanceID this(%v) Not Equal that(%v)", this.InstanceID, that1.InstanceID) } if len(this.Cmds) != len(that1.Cmds) { - return fmt2.Errorf("Cmds this(%v) Not Equal that(%v)", len(this.Cmds), len(that1.Cmds)) + return fmt3.Errorf("Cmds this(%v) Not Equal that(%v)", len(this.Cmds), len(that1.Cmds)) } for i := range this.Cmds { if !bytes.Equal(this.Cmds[i], that1.Cmds[i]) { - return fmt2.Errorf("Cmds this[%v](%v) Not Equal that[%v](%v)", i, this.Cmds[i], i, that1.Cmds[i]) + return fmt3.Errorf("Cmds this[%v](%v) Not Equal that[%v](%v)", i, this.Cmds[i], i, that1.Cmds[i]) } } if len(this.Deps) != len(that1.Deps) { - return fmt2.Errorf("Deps this(%v) Not Equal that(%v)", len(this.Deps), len(that1.Deps)) + return fmt3.Errorf("Deps this(%v) Not Equal that(%v)", len(this.Deps), len(that1.Deps)) } for i := range this.Deps { if this.Deps[i] != that1.Deps[i] { - return fmt2.Errorf("Deps this[%v](%v) Not Equal that[%v](%v)", i, this.Deps[i], i, that1.Deps[i]) + return fmt3.Errorf("Deps this[%v](%v) Not Equal that[%v](%v)", i, this.Deps[i], i, that1.Deps[i]) } } if !this.Ballot.Equal(that1.Ballot) { - return fmt2.Errorf("Ballot this(%v) Not Equal that(%v)", this.Ballot, that1.Ballot) + return fmt3.Errorf("Ballot this(%v) Not Equal that(%v)", this.Ballot, that1.Ballot) } if this.From != nil && that1.From != nil { if *this.From != *that1.From { - return fmt2.Errorf("From this(%v) Not Equal that(%v)", *this.From, *that1.From) + return fmt3.Errorf("From this(%v) Not Equal that(%v)", *this.From, *that1.From) } } else if this.From != nil { - return fmt2.Errorf("this.From == nil && that.From != nil") + return fmt3.Errorf("this.From == nil && that.From != nil") } else if that1.From != nil { - return fmt2.Errorf("From this(%v) Not Equal that(%v)", this.From, that1.From) + return fmt3.Errorf("From this(%v) Not Equal that(%v)", this.From, that1.From) } if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt2.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) + return fmt3.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) } return nil } @@ -3295,50 +3339,50 @@ func (this *PreAcceptOK) VerboseEqual(that interface{}) error { if this == nil { return nil } - return fmt2.Errorf("that == nil && this != nil") + return fmt3.Errorf("that == nil && this != nil") } that1, ok := that.(*PreAcceptOK) if !ok { - return fmt2.Errorf("that is not of type *PreAcceptOK") + return fmt3.Errorf("that is not of type *PreAcceptOK") } if that1 == nil { if this == nil { return nil } - return fmt2.Errorf("that is type *PreAcceptOK but is nil && this != nil") + return fmt3.Errorf("that is type *PreAcceptOK but is nil && this != nil") } else if this == nil { - return fmt2.Errorf("that is type *PreAcceptOKbut is not nil && this == nil") + return fmt3.Errorf("that is type *PreAcceptOKbut is not nil && this == nil") } if this.ReplicaID != nil && that1.ReplicaID != nil { if *this.ReplicaID != *that1.ReplicaID { - return fmt2.Errorf("ReplicaID this(%v) Not Equal that(%v)", *this.ReplicaID, *that1.ReplicaID) + return fmt3.Errorf("ReplicaID this(%v) Not Equal that(%v)", *this.ReplicaID, *that1.ReplicaID) } } else if this.ReplicaID != nil { - return fmt2.Errorf("this.ReplicaID == nil && that.ReplicaID != nil") + return fmt3.Errorf("this.ReplicaID == nil && that.ReplicaID != nil") } else if that1.ReplicaID != nil { - return fmt2.Errorf("ReplicaID this(%v) Not Equal that(%v)", this.ReplicaID, that1.ReplicaID) + return fmt3.Errorf("ReplicaID this(%v) Not Equal that(%v)", this.ReplicaID, that1.ReplicaID) } if this.InstanceID != nil && that1.InstanceID != nil { if *this.InstanceID != *that1.InstanceID { - return fmt2.Errorf("InstanceID this(%v) Not Equal that(%v)", *this.InstanceID, *that1.InstanceID) + return fmt3.Errorf("InstanceID this(%v) Not Equal that(%v)", *this.InstanceID, *that1.InstanceID) } } else if this.InstanceID != nil { - return fmt2.Errorf("this.InstanceID == nil && that.InstanceID != nil") + return fmt3.Errorf("this.InstanceID == nil && that.InstanceID != nil") } else if that1.InstanceID != nil { - return fmt2.Errorf("InstanceID this(%v) Not Equal that(%v)", this.InstanceID, that1.InstanceID) + return fmt3.Errorf("InstanceID this(%v) Not Equal that(%v)", this.InstanceID, that1.InstanceID) } if this.From != nil && that1.From != nil { if *this.From != *that1.From { - return fmt2.Errorf("From this(%v) Not Equal that(%v)", *this.From, *that1.From) + return fmt3.Errorf("From this(%v) Not Equal that(%v)", *this.From, *that1.From) } } else if this.From != nil { - return fmt2.Errorf("this.From == nil && that.From != nil") + return fmt3.Errorf("this.From == nil && that.From != nil") } else if that1.From != nil { - return fmt2.Errorf("From this(%v) Not Equal that(%v)", this.From, that1.From) + return fmt3.Errorf("From this(%v) Not Equal that(%v)", this.From, that1.From) } if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt2.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) + return fmt3.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) } return nil } @@ -3399,61 +3443,61 @@ func (this *PreAcceptReply) VerboseEqual(that interface{}) error { if this == nil { return nil } - return fmt2.Errorf("that == nil && this != nil") + return fmt3.Errorf("that == nil && this != nil") } that1, ok := that.(*PreAcceptReply) if !ok { - return fmt2.Errorf("that is not of type *PreAcceptReply") + return fmt3.Errorf("that is not of type *PreAcceptReply") } if that1 == nil { if this == nil { return nil } - return fmt2.Errorf("that is type *PreAcceptReply but is nil && this != nil") + return fmt3.Errorf("that is type *PreAcceptReply but is nil && this != nil") } else if this == nil { - return fmt2.Errorf("that is type *PreAcceptReplybut is not nil && this == nil") + return fmt3.Errorf("that is type *PreAcceptReplybut is not nil && this == nil") } if this.ReplicaID != nil && that1.ReplicaID != nil { if *this.ReplicaID != *that1.ReplicaID { - return fmt2.Errorf("ReplicaID this(%v) Not Equal that(%v)", *this.ReplicaID, *that1.ReplicaID) + return fmt3.Errorf("ReplicaID this(%v) Not Equal that(%v)", *this.ReplicaID, *that1.ReplicaID) } } else if this.ReplicaID != nil { - return fmt2.Errorf("this.ReplicaID == nil && that.ReplicaID != nil") + return fmt3.Errorf("this.ReplicaID == nil && that.ReplicaID != nil") } else if that1.ReplicaID != nil { - return fmt2.Errorf("ReplicaID this(%v) Not Equal that(%v)", this.ReplicaID, that1.ReplicaID) + return fmt3.Errorf("ReplicaID this(%v) Not Equal that(%v)", this.ReplicaID, that1.ReplicaID) } if this.InstanceID != nil && that1.InstanceID != nil { if *this.InstanceID != *that1.InstanceID { - return fmt2.Errorf("InstanceID this(%v) Not Equal that(%v)", *this.InstanceID, *that1.InstanceID) + return fmt3.Errorf("InstanceID this(%v) Not Equal that(%v)", *this.InstanceID, *that1.InstanceID) } } else if this.InstanceID != nil { - return fmt2.Errorf("this.InstanceID == nil && that.InstanceID != nil") + return fmt3.Errorf("this.InstanceID == nil && that.InstanceID != nil") } else if that1.InstanceID != nil { - return fmt2.Errorf("InstanceID this(%v) Not Equal that(%v)", this.InstanceID, that1.InstanceID) + return fmt3.Errorf("InstanceID this(%v) Not Equal that(%v)", this.InstanceID, that1.InstanceID) } if len(this.Deps) != len(that1.Deps) { - return fmt2.Errorf("Deps this(%v) Not Equal that(%v)", len(this.Deps), len(that1.Deps)) + return fmt3.Errorf("Deps this(%v) Not Equal that(%v)", len(this.Deps), len(that1.Deps)) } for i := range this.Deps { if this.Deps[i] != that1.Deps[i] { - return fmt2.Errorf("Deps this[%v](%v) Not Equal that[%v](%v)", i, this.Deps[i], i, that1.Deps[i]) + return fmt3.Errorf("Deps this[%v](%v) Not Equal that[%v](%v)", i, this.Deps[i], i, that1.Deps[i]) } } if !this.Ballot.Equal(that1.Ballot) { - return fmt2.Errorf("Ballot this(%v) Not Equal that(%v)", this.Ballot, that1.Ballot) + return fmt3.Errorf("Ballot this(%v) Not Equal that(%v)", this.Ballot, that1.Ballot) } if this.From != nil && that1.From != nil { if *this.From != *that1.From { - return fmt2.Errorf("From this(%v) Not Equal that(%v)", *this.From, *that1.From) + return fmt3.Errorf("From this(%v) Not Equal that(%v)", *this.From, *that1.From) } } else if this.From != nil { - return fmt2.Errorf("this.From == nil && that.From != nil") + return fmt3.Errorf("this.From == nil && that.From != nil") } else if that1.From != nil { - return fmt2.Errorf("From this(%v) Not Equal that(%v)", this.From, that1.From) + return fmt3.Errorf("From this(%v) Not Equal that(%v)", this.From, that1.From) } if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt2.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) + return fmt3.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) } return nil } @@ -3525,69 +3569,69 @@ func (this *Accept) VerboseEqual(that interface{}) error { if this == nil { return nil } - return fmt2.Errorf("that == nil && this != nil") + return fmt3.Errorf("that == nil && this != nil") } that1, ok := that.(*Accept) if !ok { - return fmt2.Errorf("that is not of type *Accept") + return fmt3.Errorf("that is not of type *Accept") } if that1 == nil { if this == nil { return nil } - return fmt2.Errorf("that is type *Accept but is nil && this != nil") + return fmt3.Errorf("that is type *Accept but is nil && this != nil") } else if this == nil { - return fmt2.Errorf("that is type *Acceptbut is not nil && this == nil") + return fmt3.Errorf("that is type *Acceptbut is not nil && this == nil") } if this.ReplicaID != nil && that1.ReplicaID != nil { if *this.ReplicaID != *that1.ReplicaID { - return fmt2.Errorf("ReplicaID this(%v) Not Equal that(%v)", *this.ReplicaID, *that1.ReplicaID) + return fmt3.Errorf("ReplicaID this(%v) Not Equal that(%v)", *this.ReplicaID, *that1.ReplicaID) } } else if this.ReplicaID != nil { - return fmt2.Errorf("this.ReplicaID == nil && that.ReplicaID != nil") + return fmt3.Errorf("this.ReplicaID == nil && that.ReplicaID != nil") } else if that1.ReplicaID != nil { - return fmt2.Errorf("ReplicaID this(%v) Not Equal that(%v)", this.ReplicaID, that1.ReplicaID) + return fmt3.Errorf("ReplicaID this(%v) Not Equal that(%v)", this.ReplicaID, that1.ReplicaID) } if this.InstanceID != nil && that1.InstanceID != nil { if *this.InstanceID != *that1.InstanceID { - return fmt2.Errorf("InstanceID this(%v) Not Equal that(%v)", *this.InstanceID, *that1.InstanceID) + return fmt3.Errorf("InstanceID this(%v) Not Equal that(%v)", *this.InstanceID, *that1.InstanceID) } } else if this.InstanceID != nil { - return fmt2.Errorf("this.InstanceID == nil && that.InstanceID != nil") + return fmt3.Errorf("this.InstanceID == nil && that.InstanceID != nil") } else if that1.InstanceID != nil { - return fmt2.Errorf("InstanceID this(%v) Not Equal that(%v)", this.InstanceID, that1.InstanceID) + return fmt3.Errorf("InstanceID this(%v) Not Equal that(%v)", this.InstanceID, that1.InstanceID) } if len(this.Cmds) != len(that1.Cmds) { - return fmt2.Errorf("Cmds this(%v) Not Equal that(%v)", len(this.Cmds), len(that1.Cmds)) + return fmt3.Errorf("Cmds this(%v) Not Equal that(%v)", len(this.Cmds), len(that1.Cmds)) } for i := range this.Cmds { if !bytes.Equal(this.Cmds[i], that1.Cmds[i]) { - return fmt2.Errorf("Cmds this[%v](%v) Not Equal that[%v](%v)", i, this.Cmds[i], i, that1.Cmds[i]) + return fmt3.Errorf("Cmds this[%v](%v) Not Equal that[%v](%v)", i, this.Cmds[i], i, that1.Cmds[i]) } } if len(this.Deps) != len(that1.Deps) { - return fmt2.Errorf("Deps this(%v) Not Equal that(%v)", len(this.Deps), len(that1.Deps)) + return fmt3.Errorf("Deps this(%v) Not Equal that(%v)", len(this.Deps), len(that1.Deps)) } for i := range this.Deps { if this.Deps[i] != that1.Deps[i] { - return fmt2.Errorf("Deps this[%v](%v) Not Equal that[%v](%v)", i, this.Deps[i], i, that1.Deps[i]) + return fmt3.Errorf("Deps this[%v](%v) Not Equal that[%v](%v)", i, this.Deps[i], i, that1.Deps[i]) } } if !this.Ballot.Equal(that1.Ballot) { - return fmt2.Errorf("Ballot this(%v) Not Equal that(%v)", this.Ballot, that1.Ballot) + return fmt3.Errorf("Ballot this(%v) Not Equal that(%v)", this.Ballot, that1.Ballot) } if this.From != nil && that1.From != nil { if *this.From != *that1.From { - return fmt2.Errorf("From this(%v) Not Equal that(%v)", *this.From, *that1.From) + return fmt3.Errorf("From this(%v) Not Equal that(%v)", *this.From, *that1.From) } } else if this.From != nil { - return fmt2.Errorf("this.From == nil && that.From != nil") + return fmt3.Errorf("this.From == nil && that.From != nil") } else if that1.From != nil { - return fmt2.Errorf("From this(%v) Not Equal that(%v)", this.From, that1.From) + return fmt3.Errorf("From this(%v) Not Equal that(%v)", this.From, that1.From) } if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt2.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) + return fmt3.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) } return nil } @@ -3667,53 +3711,53 @@ func (this *AcceptReply) VerboseEqual(that interface{}) error { if this == nil { return nil } - return fmt2.Errorf("that == nil && this != nil") + return fmt3.Errorf("that == nil && this != nil") } that1, ok := that.(*AcceptReply) if !ok { - return fmt2.Errorf("that is not of type *AcceptReply") + return fmt3.Errorf("that is not of type *AcceptReply") } if that1 == nil { if this == nil { return nil } - return fmt2.Errorf("that is type *AcceptReply but is nil && this != nil") + return fmt3.Errorf("that is type *AcceptReply but is nil && this != nil") } else if this == nil { - return fmt2.Errorf("that is type *AcceptReplybut is not nil && this == nil") + return fmt3.Errorf("that is type *AcceptReplybut is not nil && this == nil") } if this.ReplicaID != nil && that1.ReplicaID != nil { if *this.ReplicaID != *that1.ReplicaID { - return fmt2.Errorf("ReplicaID this(%v) Not Equal that(%v)", *this.ReplicaID, *that1.ReplicaID) + return fmt3.Errorf("ReplicaID this(%v) Not Equal that(%v)", *this.ReplicaID, *that1.ReplicaID) } } else if this.ReplicaID != nil { - return fmt2.Errorf("this.ReplicaID == nil && that.ReplicaID != nil") + return fmt3.Errorf("this.ReplicaID == nil && that.ReplicaID != nil") } else if that1.ReplicaID != nil { - return fmt2.Errorf("ReplicaID this(%v) Not Equal that(%v)", this.ReplicaID, that1.ReplicaID) + return fmt3.Errorf("ReplicaID this(%v) Not Equal that(%v)", this.ReplicaID, that1.ReplicaID) } if this.InstanceID != nil && that1.InstanceID != nil { if *this.InstanceID != *that1.InstanceID { - return fmt2.Errorf("InstanceID this(%v) Not Equal that(%v)", *this.InstanceID, *that1.InstanceID) + return fmt3.Errorf("InstanceID this(%v) Not Equal that(%v)", *this.InstanceID, *that1.InstanceID) } } else if this.InstanceID != nil { - return fmt2.Errorf("this.InstanceID == nil && that.InstanceID != nil") + return fmt3.Errorf("this.InstanceID == nil && that.InstanceID != nil") } else if that1.InstanceID != nil { - return fmt2.Errorf("InstanceID this(%v) Not Equal that(%v)", this.InstanceID, that1.InstanceID) + return fmt3.Errorf("InstanceID this(%v) Not Equal that(%v)", this.InstanceID, that1.InstanceID) } if !this.Ballot.Equal(that1.Ballot) { - return fmt2.Errorf("Ballot this(%v) Not Equal that(%v)", this.Ballot, that1.Ballot) + return fmt3.Errorf("Ballot this(%v) Not Equal that(%v)", this.Ballot, that1.Ballot) } if this.From != nil && that1.From != nil { if *this.From != *that1.From { - return fmt2.Errorf("From this(%v) Not Equal that(%v)", *this.From, *that1.From) + return fmt3.Errorf("From this(%v) Not Equal that(%v)", *this.From, *that1.From) } } else if this.From != nil { - return fmt2.Errorf("this.From == nil && that.From != nil") + return fmt3.Errorf("this.From == nil && that.From != nil") } else if that1.From != nil { - return fmt2.Errorf("From this(%v) Not Equal that(%v)", this.From, that1.From) + return fmt3.Errorf("From this(%v) Not Equal that(%v)", this.From, that1.From) } if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt2.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) + return fmt3.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) } return nil } @@ -3777,53 +3821,53 @@ func (this *Prepare) VerboseEqual(that interface{}) error { if this == nil { return nil } - return fmt2.Errorf("that == nil && this != nil") + return fmt3.Errorf("that == nil && this != nil") } that1, ok := that.(*Prepare) if !ok { - return fmt2.Errorf("that is not of type *Prepare") + return fmt3.Errorf("that is not of type *Prepare") } if that1 == nil { if this == nil { return nil } - return fmt2.Errorf("that is type *Prepare but is nil && this != nil") + return fmt3.Errorf("that is type *Prepare but is nil && this != nil") } else if this == nil { - return fmt2.Errorf("that is type *Preparebut is not nil && this == nil") + return fmt3.Errorf("that is type *Preparebut is not nil && this == nil") } if this.ReplicaID != nil && that1.ReplicaID != nil { if *this.ReplicaID != *that1.ReplicaID { - return fmt2.Errorf("ReplicaID this(%v) Not Equal that(%v)", *this.ReplicaID, *that1.ReplicaID) + return fmt3.Errorf("ReplicaID this(%v) Not Equal that(%v)", *this.ReplicaID, *that1.ReplicaID) } } else if this.ReplicaID != nil { - return fmt2.Errorf("this.ReplicaID == nil && that.ReplicaID != nil") + return fmt3.Errorf("this.ReplicaID == nil && that.ReplicaID != nil") } else if that1.ReplicaID != nil { - return fmt2.Errorf("ReplicaID this(%v) Not Equal that(%v)", this.ReplicaID, that1.ReplicaID) + return fmt3.Errorf("ReplicaID this(%v) Not Equal that(%v)", this.ReplicaID, that1.ReplicaID) } if this.InstanceID != nil && that1.InstanceID != nil { if *this.InstanceID != *that1.InstanceID { - return fmt2.Errorf("InstanceID this(%v) Not Equal that(%v)", *this.InstanceID, *that1.InstanceID) + return fmt3.Errorf("InstanceID this(%v) Not Equal that(%v)", *this.InstanceID, *that1.InstanceID) } } else if this.InstanceID != nil { - return fmt2.Errorf("this.InstanceID == nil && that.InstanceID != nil") + return fmt3.Errorf("this.InstanceID == nil && that.InstanceID != nil") } else if that1.InstanceID != nil { - return fmt2.Errorf("InstanceID this(%v) Not Equal that(%v)", this.InstanceID, that1.InstanceID) + return fmt3.Errorf("InstanceID this(%v) Not Equal that(%v)", this.InstanceID, that1.InstanceID) } if !this.Ballot.Equal(that1.Ballot) { - return fmt2.Errorf("Ballot this(%v) Not Equal that(%v)", this.Ballot, that1.Ballot) + return fmt3.Errorf("Ballot this(%v) Not Equal that(%v)", this.Ballot, that1.Ballot) } if this.From != nil && that1.From != nil { if *this.From != *that1.From { - return fmt2.Errorf("From this(%v) Not Equal that(%v)", *this.From, *that1.From) + return fmt3.Errorf("From this(%v) Not Equal that(%v)", *this.From, *that1.From) } } else if this.From != nil { - return fmt2.Errorf("this.From == nil && that.From != nil") + return fmt3.Errorf("this.From == nil && that.From != nil") } else if that1.From != nil { - return fmt2.Errorf("From this(%v) Not Equal that(%v)", this.From, that1.From) + return fmt3.Errorf("From this(%v) Not Equal that(%v)", this.From, that1.From) } if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt2.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) + return fmt3.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) } return nil } @@ -3887,90 +3931,90 @@ func (this *PrepareReply) VerboseEqual(that interface{}) error { if this == nil { return nil } - return fmt2.Errorf("that == nil && this != nil") + return fmt3.Errorf("that == nil && this != nil") } that1, ok := that.(*PrepareReply) if !ok { - return fmt2.Errorf("that is not of type *PrepareReply") + return fmt3.Errorf("that is not of type *PrepareReply") } if that1 == nil { if this == nil { return nil } - return fmt2.Errorf("that is type *PrepareReply but is nil && this != nil") + return fmt3.Errorf("that is type *PrepareReply but is nil && this != nil") } else if this == nil { - return fmt2.Errorf("that is type *PrepareReplybut is not nil && this == nil") + return fmt3.Errorf("that is type *PrepareReplybut is not nil && this == nil") } if this.ReplicaID != nil && that1.ReplicaID != nil { if *this.ReplicaID != *that1.ReplicaID { - return fmt2.Errorf("ReplicaID this(%v) Not Equal that(%v)", *this.ReplicaID, *that1.ReplicaID) + return fmt3.Errorf("ReplicaID this(%v) Not Equal that(%v)", *this.ReplicaID, *that1.ReplicaID) } } else if this.ReplicaID != nil { - return fmt2.Errorf("this.ReplicaID == nil && that.ReplicaID != nil") + return fmt3.Errorf("this.ReplicaID == nil && that.ReplicaID != nil") } else if that1.ReplicaID != nil { - return fmt2.Errorf("ReplicaID this(%v) Not Equal that(%v)", this.ReplicaID, that1.ReplicaID) + return fmt3.Errorf("ReplicaID this(%v) Not Equal that(%v)", this.ReplicaID, that1.ReplicaID) } if this.InstanceID != nil && that1.InstanceID != nil { if *this.InstanceID != *that1.InstanceID { - return fmt2.Errorf("InstanceID this(%v) Not Equal that(%v)", *this.InstanceID, *that1.InstanceID) + return fmt3.Errorf("InstanceID this(%v) Not Equal that(%v)", *this.InstanceID, *that1.InstanceID) } } else if this.InstanceID != nil { - return fmt2.Errorf("this.InstanceID == nil && that.InstanceID != nil") + return fmt3.Errorf("this.InstanceID == nil && that.InstanceID != nil") } else if that1.InstanceID != nil { - return fmt2.Errorf("InstanceID this(%v) Not Equal that(%v)", this.InstanceID, that1.InstanceID) + return fmt3.Errorf("InstanceID this(%v) Not Equal that(%v)", this.InstanceID, that1.InstanceID) } if this.State != nil && that1.State != nil { if *this.State != *that1.State { - return fmt2.Errorf("State this(%v) Not Equal that(%v)", *this.State, *that1.State) + return fmt3.Errorf("State this(%v) Not Equal that(%v)", *this.State, *that1.State) } } else if this.State != nil { - return fmt2.Errorf("this.State == nil && that.State != nil") + return fmt3.Errorf("this.State == nil && that.State != nil") } else if that1.State != nil { - return fmt2.Errorf("State this(%v) Not Equal that(%v)", this.State, that1.State) + return fmt3.Errorf("State this(%v) Not Equal that(%v)", this.State, that1.State) } if len(this.Cmds) != len(that1.Cmds) { - return fmt2.Errorf("Cmds this(%v) Not Equal that(%v)", len(this.Cmds), len(that1.Cmds)) + return fmt3.Errorf("Cmds this(%v) Not Equal that(%v)", len(this.Cmds), len(that1.Cmds)) } for i := range this.Cmds { if !bytes.Equal(this.Cmds[i], that1.Cmds[i]) { - return fmt2.Errorf("Cmds this[%v](%v) Not Equal that[%v](%v)", i, this.Cmds[i], i, that1.Cmds[i]) + return fmt3.Errorf("Cmds this[%v](%v) Not Equal that[%v](%v)", i, this.Cmds[i], i, that1.Cmds[i]) } } if len(this.Deps) != len(that1.Deps) { - return fmt2.Errorf("Deps this(%v) Not Equal that(%v)", len(this.Deps), len(that1.Deps)) + return fmt3.Errorf("Deps this(%v) Not Equal that(%v)", len(this.Deps), len(that1.Deps)) } for i := range this.Deps { if this.Deps[i] != that1.Deps[i] { - return fmt2.Errorf("Deps this[%v](%v) Not Equal that[%v](%v)", i, this.Deps[i], i, that1.Deps[i]) + return fmt3.Errorf("Deps this[%v](%v) Not Equal that[%v](%v)", i, this.Deps[i], i, that1.Deps[i]) } } if !this.Ballot.Equal(that1.Ballot) { - return fmt2.Errorf("Ballot this(%v) Not Equal that(%v)", this.Ballot, that1.Ballot) + return fmt3.Errorf("Ballot this(%v) Not Equal that(%v)", this.Ballot, that1.Ballot) } if !this.OriginalBallot.Equal(that1.OriginalBallot) { - return fmt2.Errorf("OriginalBallot this(%v) Not Equal that(%v)", this.OriginalBallot, that1.OriginalBallot) + return fmt3.Errorf("OriginalBallot this(%v) Not Equal that(%v)", this.OriginalBallot, that1.OriginalBallot) } if this.IsFromLeader != nil && that1.IsFromLeader != nil { if *this.IsFromLeader != *that1.IsFromLeader { - return fmt2.Errorf("IsFromLeader this(%v) Not Equal that(%v)", *this.IsFromLeader, *that1.IsFromLeader) + return fmt3.Errorf("IsFromLeader this(%v) Not Equal that(%v)", *this.IsFromLeader, *that1.IsFromLeader) } } else if this.IsFromLeader != nil { - return fmt2.Errorf("this.IsFromLeader == nil && that.IsFromLeader != nil") + return fmt3.Errorf("this.IsFromLeader == nil && that.IsFromLeader != nil") } else if that1.IsFromLeader != nil { - return fmt2.Errorf("IsFromLeader this(%v) Not Equal that(%v)", this.IsFromLeader, that1.IsFromLeader) + return fmt3.Errorf("IsFromLeader this(%v) Not Equal that(%v)", this.IsFromLeader, that1.IsFromLeader) } if this.From != nil && that1.From != nil { if *this.From != *that1.From { - return fmt2.Errorf("From this(%v) Not Equal that(%v)", *this.From, *that1.From) + return fmt3.Errorf("From this(%v) Not Equal that(%v)", *this.From, *that1.From) } } else if this.From != nil { - return fmt2.Errorf("this.From == nil && that.From != nil") + return fmt3.Errorf("this.From == nil && that.From != nil") } else if that1.From != nil { - return fmt2.Errorf("From this(%v) Not Equal that(%v)", this.From, that1.From) + return fmt3.Errorf("From this(%v) Not Equal that(%v)", this.From, that1.From) } if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt2.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) + return fmt3.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) } return nil } @@ -4071,66 +4115,66 @@ func (this *Commit) VerboseEqual(that interface{}) error { if this == nil { return nil } - return fmt2.Errorf("that == nil && this != nil") + return fmt3.Errorf("that == nil && this != nil") } that1, ok := that.(*Commit) if !ok { - return fmt2.Errorf("that is not of type *Commit") + return fmt3.Errorf("that is not of type *Commit") } if that1 == nil { if this == nil { return nil } - return fmt2.Errorf("that is type *Commit but is nil && this != nil") + return fmt3.Errorf("that is type *Commit but is nil && this != nil") } else if this == nil { - return fmt2.Errorf("that is type *Commitbut is not nil && this == nil") + return fmt3.Errorf("that is type *Commitbut is not nil && this == nil") } if this.ReplicaID != nil && that1.ReplicaID != nil { if *this.ReplicaID != *that1.ReplicaID { - return fmt2.Errorf("ReplicaID this(%v) Not Equal that(%v)", *this.ReplicaID, *that1.ReplicaID) + return fmt3.Errorf("ReplicaID this(%v) Not Equal that(%v)", *this.ReplicaID, *that1.ReplicaID) } } else if this.ReplicaID != nil { - return fmt2.Errorf("this.ReplicaID == nil && that.ReplicaID != nil") + return fmt3.Errorf("this.ReplicaID == nil && that.ReplicaID != nil") } else if that1.ReplicaID != nil { - return fmt2.Errorf("ReplicaID this(%v) Not Equal that(%v)", this.ReplicaID, that1.ReplicaID) + return fmt3.Errorf("ReplicaID this(%v) Not Equal that(%v)", this.ReplicaID, that1.ReplicaID) } if this.InstancdID != nil && that1.InstancdID != nil { if *this.InstancdID != *that1.InstancdID { - return fmt2.Errorf("InstancdID this(%v) Not Equal that(%v)", *this.InstancdID, *that1.InstancdID) + return fmt3.Errorf("InstancdID this(%v) Not Equal that(%v)", *this.InstancdID, *that1.InstancdID) } } else if this.InstancdID != nil { - return fmt2.Errorf("this.InstancdID == nil && that.InstancdID != nil") + return fmt3.Errorf("this.InstancdID == nil && that.InstancdID != nil") } else if that1.InstancdID != nil { - return fmt2.Errorf("InstancdID this(%v) Not Equal that(%v)", this.InstancdID, that1.InstancdID) + return fmt3.Errorf("InstancdID this(%v) Not Equal that(%v)", this.InstancdID, that1.InstancdID) } if len(this.Cmds) != len(that1.Cmds) { - return fmt2.Errorf("Cmds this(%v) Not Equal that(%v)", len(this.Cmds), len(that1.Cmds)) + return fmt3.Errorf("Cmds this(%v) Not Equal that(%v)", len(this.Cmds), len(that1.Cmds)) } for i := range this.Cmds { if !bytes.Equal(this.Cmds[i], that1.Cmds[i]) { - return fmt2.Errorf("Cmds this[%v](%v) Not Equal that[%v](%v)", i, this.Cmds[i], i, that1.Cmds[i]) + return fmt3.Errorf("Cmds this[%v](%v) Not Equal that[%v](%v)", i, this.Cmds[i], i, that1.Cmds[i]) } } if len(this.Deps) != len(that1.Deps) { - return fmt2.Errorf("Deps this(%v) Not Equal that(%v)", len(this.Deps), len(that1.Deps)) + return fmt3.Errorf("Deps this(%v) Not Equal that(%v)", len(this.Deps), len(that1.Deps)) } for i := range this.Deps { if this.Deps[i] != that1.Deps[i] { - return fmt2.Errorf("Deps this[%v](%v) Not Equal that[%v](%v)", i, this.Deps[i], i, that1.Deps[i]) + return fmt3.Errorf("Deps this[%v](%v) Not Equal that[%v](%v)", i, this.Deps[i], i, that1.Deps[i]) } } if this.From != nil && that1.From != nil { if *this.From != *that1.From { - return fmt2.Errorf("From this(%v) Not Equal that(%v)", *this.From, *that1.From) + return fmt3.Errorf("From this(%v) Not Equal that(%v)", *this.From, *that1.From) } } else if this.From != nil { - return fmt2.Errorf("this.From == nil && that.From != nil") + return fmt3.Errorf("this.From == nil && that.From != nil") } else if that1.From != nil { - return fmt2.Errorf("From this(%v) Not Equal that(%v)", this.From, that1.From) + return fmt3.Errorf("From this(%v) Not Equal that(%v)", this.From, that1.From) } if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt2.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) + return fmt3.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) } return nil } diff --git a/protobuf/message.proto b/protobuf/message.proto index 0fb46be..e2892e3 100644 --- a/protobuf/message.proto +++ b/protobuf/message.proto @@ -1,6 +1,6 @@ package protobuf; -import "code.google.com/p/gogoprotobuf/gogoproto/gogo.proto"; +import "github.com/gogo/protobuf/gogoproto/gogo.proto"; option (gogoproto.gostring_all) = true; option (gogoproto.equal_all) = true; diff --git a/protobuf/messagepb_test.go b/protobuf/messagepb_test.go index 5286433..14d7cce 100644 --- a/protobuf/messagepb_test.go +++ b/protobuf/messagepb_test.go @@ -24,7 +24,7 @@ package protobuf import testing "testing" import math_rand "math/rand" import time "time" -import code_google_com_p_gogoprotobuf_proto "code.google.com/p/gogoprotobuf/proto" +import github_com_gogo_protobuf_proto "github.com/gogo/protobuf/proto" import testing1 "testing" import math_rand1 "math/rand" import time1 "time" @@ -32,7 +32,7 @@ import encoding_json "encoding/json" import testing2 "testing" import math_rand2 "math/rand" import time2 "time" -import code_google_com_p_gogoprotobuf_proto1 "code.google.com/p/gogoprotobuf/proto" +import github_com_gogo_protobuf_proto1 "github.com/gogo/protobuf/proto" import math_rand3 "math/rand" import time3 "time" import testing3 "testing" @@ -40,7 +40,7 @@ import fmt "fmt" import math_rand4 "math/rand" import time4 "time" import testing4 "testing" -import code_google_com_p_gogoprotobuf_proto2 "code.google.com/p/gogoprotobuf/proto" +import github_com_gogo_protobuf_proto2 "github.com/gogo/protobuf/proto" import math_rand5 "math/rand" import time5 "time" import testing5 "testing" @@ -49,17 +49,17 @@ import go_parser "go/parser" import math_rand6 "math/rand" import time6 "time" import testing6 "testing" -import code_google_com_p_gogoprotobuf_proto3 "code.google.com/p/gogoprotobuf/proto" +import github_com_gogo_protobuf_proto3 "github.com/gogo/protobuf/proto" func TestBallotProto(t *testing.T) { popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) p := NewPopulatedBallot(popr, false) - data, err := code_google_com_p_gogoprotobuf_proto.Marshal(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { panic(err) } msg := &Ballot{} - if err := code_google_com_p_gogoprotobuf_proto.Unmarshal(data, msg); err != nil { + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { panic(err) } for i := range data { @@ -86,7 +86,7 @@ func TestBallotMarshalTo(t *testing.T) { panic(err) } msg := &Ballot{} - if err := code_google_com_p_gogoprotobuf_proto.Unmarshal(data, msg); err != nil { + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { panic(err) } for i := range data { @@ -109,7 +109,7 @@ func BenchmarkBallotProtoMarshal(b *testing.B) { } b.ResetTimer() for i := 0; i < b.N; i++ { - data, err := code_google_com_p_gogoprotobuf_proto.Marshal(pops[i%10000]) + data, err := github_com_gogo_protobuf_proto.Marshal(pops[i%10000]) if err != nil { panic(err) } @@ -123,7 +123,7 @@ func BenchmarkBallotProtoUnmarshal(b *testing.B) { total := 0 datas := make([][]byte, 10000) for i := 0; i < 10000; i++ { - data, err := code_google_com_p_gogoprotobuf_proto.Marshal(NewPopulatedBallot(popr, false)) + data, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedBallot(popr, false)) if err != nil { panic(err) } @@ -133,7 +133,7 @@ func BenchmarkBallotProtoUnmarshal(b *testing.B) { b.ResetTimer() for i := 0; i < b.N; i++ { total += len(datas[i%10000]) - if err := code_google_com_p_gogoprotobuf_proto.Unmarshal(datas[i%10000], msg); err != nil { + if err := github_com_gogo_protobuf_proto.Unmarshal(datas[i%10000], msg); err != nil { panic(err) } } @@ -143,12 +143,12 @@ func BenchmarkBallotProtoUnmarshal(b *testing.B) { func TestPreAcceptProto(t *testing.T) { popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) p := NewPopulatedPreAccept(popr, false) - data, err := code_google_com_p_gogoprotobuf_proto.Marshal(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { panic(err) } msg := &PreAccept{} - if err := code_google_com_p_gogoprotobuf_proto.Unmarshal(data, msg); err != nil { + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { panic(err) } for i := range data { @@ -175,7 +175,7 @@ func TestPreAcceptMarshalTo(t *testing.T) { panic(err) } msg := &PreAccept{} - if err := code_google_com_p_gogoprotobuf_proto.Unmarshal(data, msg); err != nil { + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { panic(err) } for i := range data { @@ -198,7 +198,7 @@ func BenchmarkPreAcceptProtoMarshal(b *testing.B) { } b.ResetTimer() for i := 0; i < b.N; i++ { - data, err := code_google_com_p_gogoprotobuf_proto.Marshal(pops[i%10000]) + data, err := github_com_gogo_protobuf_proto.Marshal(pops[i%10000]) if err != nil { panic(err) } @@ -212,7 +212,7 @@ func BenchmarkPreAcceptProtoUnmarshal(b *testing.B) { total := 0 datas := make([][]byte, 10000) for i := 0; i < 10000; i++ { - data, err := code_google_com_p_gogoprotobuf_proto.Marshal(NewPopulatedPreAccept(popr, false)) + data, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedPreAccept(popr, false)) if err != nil { panic(err) } @@ -222,7 +222,7 @@ func BenchmarkPreAcceptProtoUnmarshal(b *testing.B) { b.ResetTimer() for i := 0; i < b.N; i++ { total += len(datas[i%10000]) - if err := code_google_com_p_gogoprotobuf_proto.Unmarshal(datas[i%10000], msg); err != nil { + if err := github_com_gogo_protobuf_proto.Unmarshal(datas[i%10000], msg); err != nil { panic(err) } } @@ -232,12 +232,12 @@ func BenchmarkPreAcceptProtoUnmarshal(b *testing.B) { func TestPreAcceptOKProto(t *testing.T) { popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) p := NewPopulatedPreAcceptOK(popr, false) - data, err := code_google_com_p_gogoprotobuf_proto.Marshal(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { panic(err) } msg := &PreAcceptOK{} - if err := code_google_com_p_gogoprotobuf_proto.Unmarshal(data, msg); err != nil { + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { panic(err) } for i := range data { @@ -264,7 +264,7 @@ func TestPreAcceptOKMarshalTo(t *testing.T) { panic(err) } msg := &PreAcceptOK{} - if err := code_google_com_p_gogoprotobuf_proto.Unmarshal(data, msg); err != nil { + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { panic(err) } for i := range data { @@ -287,7 +287,7 @@ func BenchmarkPreAcceptOKProtoMarshal(b *testing.B) { } b.ResetTimer() for i := 0; i < b.N; i++ { - data, err := code_google_com_p_gogoprotobuf_proto.Marshal(pops[i%10000]) + data, err := github_com_gogo_protobuf_proto.Marshal(pops[i%10000]) if err != nil { panic(err) } @@ -301,7 +301,7 @@ func BenchmarkPreAcceptOKProtoUnmarshal(b *testing.B) { total := 0 datas := make([][]byte, 10000) for i := 0; i < 10000; i++ { - data, err := code_google_com_p_gogoprotobuf_proto.Marshal(NewPopulatedPreAcceptOK(popr, false)) + data, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedPreAcceptOK(popr, false)) if err != nil { panic(err) } @@ -311,7 +311,7 @@ func BenchmarkPreAcceptOKProtoUnmarshal(b *testing.B) { b.ResetTimer() for i := 0; i < b.N; i++ { total += len(datas[i%10000]) - if err := code_google_com_p_gogoprotobuf_proto.Unmarshal(datas[i%10000], msg); err != nil { + if err := github_com_gogo_protobuf_proto.Unmarshal(datas[i%10000], msg); err != nil { panic(err) } } @@ -321,12 +321,12 @@ func BenchmarkPreAcceptOKProtoUnmarshal(b *testing.B) { func TestPreAcceptReplyProto(t *testing.T) { popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) p := NewPopulatedPreAcceptReply(popr, false) - data, err := code_google_com_p_gogoprotobuf_proto.Marshal(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { panic(err) } msg := &PreAcceptReply{} - if err := code_google_com_p_gogoprotobuf_proto.Unmarshal(data, msg); err != nil { + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { panic(err) } for i := range data { @@ -353,7 +353,7 @@ func TestPreAcceptReplyMarshalTo(t *testing.T) { panic(err) } msg := &PreAcceptReply{} - if err := code_google_com_p_gogoprotobuf_proto.Unmarshal(data, msg); err != nil { + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { panic(err) } for i := range data { @@ -376,7 +376,7 @@ func BenchmarkPreAcceptReplyProtoMarshal(b *testing.B) { } b.ResetTimer() for i := 0; i < b.N; i++ { - data, err := code_google_com_p_gogoprotobuf_proto.Marshal(pops[i%10000]) + data, err := github_com_gogo_protobuf_proto.Marshal(pops[i%10000]) if err != nil { panic(err) } @@ -390,7 +390,7 @@ func BenchmarkPreAcceptReplyProtoUnmarshal(b *testing.B) { total := 0 datas := make([][]byte, 10000) for i := 0; i < 10000; i++ { - data, err := code_google_com_p_gogoprotobuf_proto.Marshal(NewPopulatedPreAcceptReply(popr, false)) + data, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedPreAcceptReply(popr, false)) if err != nil { panic(err) } @@ -400,7 +400,7 @@ func BenchmarkPreAcceptReplyProtoUnmarshal(b *testing.B) { b.ResetTimer() for i := 0; i < b.N; i++ { total += len(datas[i%10000]) - if err := code_google_com_p_gogoprotobuf_proto.Unmarshal(datas[i%10000], msg); err != nil { + if err := github_com_gogo_protobuf_proto.Unmarshal(datas[i%10000], msg); err != nil { panic(err) } } @@ -410,12 +410,12 @@ func BenchmarkPreAcceptReplyProtoUnmarshal(b *testing.B) { func TestAcceptProto(t *testing.T) { popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) p := NewPopulatedAccept(popr, false) - data, err := code_google_com_p_gogoprotobuf_proto.Marshal(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { panic(err) } msg := &Accept{} - if err := code_google_com_p_gogoprotobuf_proto.Unmarshal(data, msg); err != nil { + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { panic(err) } for i := range data { @@ -442,7 +442,7 @@ func TestAcceptMarshalTo(t *testing.T) { panic(err) } msg := &Accept{} - if err := code_google_com_p_gogoprotobuf_proto.Unmarshal(data, msg); err != nil { + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { panic(err) } for i := range data { @@ -465,7 +465,7 @@ func BenchmarkAcceptProtoMarshal(b *testing.B) { } b.ResetTimer() for i := 0; i < b.N; i++ { - data, err := code_google_com_p_gogoprotobuf_proto.Marshal(pops[i%10000]) + data, err := github_com_gogo_protobuf_proto.Marshal(pops[i%10000]) if err != nil { panic(err) } @@ -479,7 +479,7 @@ func BenchmarkAcceptProtoUnmarshal(b *testing.B) { total := 0 datas := make([][]byte, 10000) for i := 0; i < 10000; i++ { - data, err := code_google_com_p_gogoprotobuf_proto.Marshal(NewPopulatedAccept(popr, false)) + data, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedAccept(popr, false)) if err != nil { panic(err) } @@ -489,7 +489,7 @@ func BenchmarkAcceptProtoUnmarshal(b *testing.B) { b.ResetTimer() for i := 0; i < b.N; i++ { total += len(datas[i%10000]) - if err := code_google_com_p_gogoprotobuf_proto.Unmarshal(datas[i%10000], msg); err != nil { + if err := github_com_gogo_protobuf_proto.Unmarshal(datas[i%10000], msg); err != nil { panic(err) } } @@ -499,12 +499,12 @@ func BenchmarkAcceptProtoUnmarshal(b *testing.B) { func TestAcceptReplyProto(t *testing.T) { popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) p := NewPopulatedAcceptReply(popr, false) - data, err := code_google_com_p_gogoprotobuf_proto.Marshal(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { panic(err) } msg := &AcceptReply{} - if err := code_google_com_p_gogoprotobuf_proto.Unmarshal(data, msg); err != nil { + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { panic(err) } for i := range data { @@ -531,7 +531,7 @@ func TestAcceptReplyMarshalTo(t *testing.T) { panic(err) } msg := &AcceptReply{} - if err := code_google_com_p_gogoprotobuf_proto.Unmarshal(data, msg); err != nil { + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { panic(err) } for i := range data { @@ -554,7 +554,7 @@ func BenchmarkAcceptReplyProtoMarshal(b *testing.B) { } b.ResetTimer() for i := 0; i < b.N; i++ { - data, err := code_google_com_p_gogoprotobuf_proto.Marshal(pops[i%10000]) + data, err := github_com_gogo_protobuf_proto.Marshal(pops[i%10000]) if err != nil { panic(err) } @@ -568,7 +568,7 @@ func BenchmarkAcceptReplyProtoUnmarshal(b *testing.B) { total := 0 datas := make([][]byte, 10000) for i := 0; i < 10000; i++ { - data, err := code_google_com_p_gogoprotobuf_proto.Marshal(NewPopulatedAcceptReply(popr, false)) + data, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedAcceptReply(popr, false)) if err != nil { panic(err) } @@ -578,7 +578,7 @@ func BenchmarkAcceptReplyProtoUnmarshal(b *testing.B) { b.ResetTimer() for i := 0; i < b.N; i++ { total += len(datas[i%10000]) - if err := code_google_com_p_gogoprotobuf_proto.Unmarshal(datas[i%10000], msg); err != nil { + if err := github_com_gogo_protobuf_proto.Unmarshal(datas[i%10000], msg); err != nil { panic(err) } } @@ -588,12 +588,12 @@ func BenchmarkAcceptReplyProtoUnmarshal(b *testing.B) { func TestPrepareProto(t *testing.T) { popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) p := NewPopulatedPrepare(popr, false) - data, err := code_google_com_p_gogoprotobuf_proto.Marshal(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { panic(err) } msg := &Prepare{} - if err := code_google_com_p_gogoprotobuf_proto.Unmarshal(data, msg); err != nil { + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { panic(err) } for i := range data { @@ -620,7 +620,7 @@ func TestPrepareMarshalTo(t *testing.T) { panic(err) } msg := &Prepare{} - if err := code_google_com_p_gogoprotobuf_proto.Unmarshal(data, msg); err != nil { + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { panic(err) } for i := range data { @@ -643,7 +643,7 @@ func BenchmarkPrepareProtoMarshal(b *testing.B) { } b.ResetTimer() for i := 0; i < b.N; i++ { - data, err := code_google_com_p_gogoprotobuf_proto.Marshal(pops[i%10000]) + data, err := github_com_gogo_protobuf_proto.Marshal(pops[i%10000]) if err != nil { panic(err) } @@ -657,7 +657,7 @@ func BenchmarkPrepareProtoUnmarshal(b *testing.B) { total := 0 datas := make([][]byte, 10000) for i := 0; i < 10000; i++ { - data, err := code_google_com_p_gogoprotobuf_proto.Marshal(NewPopulatedPrepare(popr, false)) + data, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedPrepare(popr, false)) if err != nil { panic(err) } @@ -667,7 +667,7 @@ func BenchmarkPrepareProtoUnmarshal(b *testing.B) { b.ResetTimer() for i := 0; i < b.N; i++ { total += len(datas[i%10000]) - if err := code_google_com_p_gogoprotobuf_proto.Unmarshal(datas[i%10000], msg); err != nil { + if err := github_com_gogo_protobuf_proto.Unmarshal(datas[i%10000], msg); err != nil { panic(err) } } @@ -677,12 +677,12 @@ func BenchmarkPrepareProtoUnmarshal(b *testing.B) { func TestPrepareReplyProto(t *testing.T) { popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) p := NewPopulatedPrepareReply(popr, false) - data, err := code_google_com_p_gogoprotobuf_proto.Marshal(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { panic(err) } msg := &PrepareReply{} - if err := code_google_com_p_gogoprotobuf_proto.Unmarshal(data, msg); err != nil { + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { panic(err) } for i := range data { @@ -709,7 +709,7 @@ func TestPrepareReplyMarshalTo(t *testing.T) { panic(err) } msg := &PrepareReply{} - if err := code_google_com_p_gogoprotobuf_proto.Unmarshal(data, msg); err != nil { + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { panic(err) } for i := range data { @@ -732,7 +732,7 @@ func BenchmarkPrepareReplyProtoMarshal(b *testing.B) { } b.ResetTimer() for i := 0; i < b.N; i++ { - data, err := code_google_com_p_gogoprotobuf_proto.Marshal(pops[i%10000]) + data, err := github_com_gogo_protobuf_proto.Marshal(pops[i%10000]) if err != nil { panic(err) } @@ -746,7 +746,7 @@ func BenchmarkPrepareReplyProtoUnmarshal(b *testing.B) { total := 0 datas := make([][]byte, 10000) for i := 0; i < 10000; i++ { - data, err := code_google_com_p_gogoprotobuf_proto.Marshal(NewPopulatedPrepareReply(popr, false)) + data, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedPrepareReply(popr, false)) if err != nil { panic(err) } @@ -756,7 +756,7 @@ func BenchmarkPrepareReplyProtoUnmarshal(b *testing.B) { b.ResetTimer() for i := 0; i < b.N; i++ { total += len(datas[i%10000]) - if err := code_google_com_p_gogoprotobuf_proto.Unmarshal(datas[i%10000], msg); err != nil { + if err := github_com_gogo_protobuf_proto.Unmarshal(datas[i%10000], msg); err != nil { panic(err) } } @@ -766,12 +766,12 @@ func BenchmarkPrepareReplyProtoUnmarshal(b *testing.B) { func TestCommitProto(t *testing.T) { popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) p := NewPopulatedCommit(popr, false) - data, err := code_google_com_p_gogoprotobuf_proto.Marshal(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { panic(err) } msg := &Commit{} - if err := code_google_com_p_gogoprotobuf_proto.Unmarshal(data, msg); err != nil { + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { panic(err) } for i := range data { @@ -798,7 +798,7 @@ func TestCommitMarshalTo(t *testing.T) { panic(err) } msg := &Commit{} - if err := code_google_com_p_gogoprotobuf_proto.Unmarshal(data, msg); err != nil { + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { panic(err) } for i := range data { @@ -821,7 +821,7 @@ func BenchmarkCommitProtoMarshal(b *testing.B) { } b.ResetTimer() for i := 0; i < b.N; i++ { - data, err := code_google_com_p_gogoprotobuf_proto.Marshal(pops[i%10000]) + data, err := github_com_gogo_protobuf_proto.Marshal(pops[i%10000]) if err != nil { panic(err) } @@ -835,7 +835,7 @@ func BenchmarkCommitProtoUnmarshal(b *testing.B) { total := 0 datas := make([][]byte, 10000) for i := 0; i < 10000; i++ { - data, err := code_google_com_p_gogoprotobuf_proto.Marshal(NewPopulatedCommit(popr, false)) + data, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedCommit(popr, false)) if err != nil { panic(err) } @@ -845,7 +845,7 @@ func BenchmarkCommitProtoUnmarshal(b *testing.B) { b.ResetTimer() for i := 0; i < b.N; i++ { total += len(datas[i%10000]) - if err := code_google_com_p_gogoprotobuf_proto.Unmarshal(datas[i%10000], msg); err != nil { + if err := github_com_gogo_protobuf_proto.Unmarshal(datas[i%10000], msg); err != nil { panic(err) } } @@ -1026,9 +1026,9 @@ func TestCommitJSON(t *testing1.T) { func TestBallotProtoText(t *testing2.T) { popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) p := NewPopulatedBallot(popr, true) - data := code_google_com_p_gogoprotobuf_proto1.MarshalTextString(p) + data := github_com_gogo_protobuf_proto1.MarshalTextString(p) msg := &Ballot{} - if err := code_google_com_p_gogoprotobuf_proto1.UnmarshalText(data, msg); err != nil { + if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { panic(err) } if err := p.VerboseEqual(msg); err != nil { @@ -1042,9 +1042,9 @@ func TestBallotProtoText(t *testing2.T) { func TestBallotProtoCompactText(t *testing2.T) { popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) p := NewPopulatedBallot(popr, true) - data := code_google_com_p_gogoprotobuf_proto1.CompactTextString(p) + data := github_com_gogo_protobuf_proto1.CompactTextString(p) msg := &Ballot{} - if err := code_google_com_p_gogoprotobuf_proto1.UnmarshalText(data, msg); err != nil { + if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { panic(err) } if err := p.VerboseEqual(msg); err != nil { @@ -1058,9 +1058,9 @@ func TestBallotProtoCompactText(t *testing2.T) { func TestPreAcceptProtoText(t *testing2.T) { popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) p := NewPopulatedPreAccept(popr, true) - data := code_google_com_p_gogoprotobuf_proto1.MarshalTextString(p) + data := github_com_gogo_protobuf_proto1.MarshalTextString(p) msg := &PreAccept{} - if err := code_google_com_p_gogoprotobuf_proto1.UnmarshalText(data, msg); err != nil { + if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { panic(err) } if err := p.VerboseEqual(msg); err != nil { @@ -1074,9 +1074,9 @@ func TestPreAcceptProtoText(t *testing2.T) { func TestPreAcceptProtoCompactText(t *testing2.T) { popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) p := NewPopulatedPreAccept(popr, true) - data := code_google_com_p_gogoprotobuf_proto1.CompactTextString(p) + data := github_com_gogo_protobuf_proto1.CompactTextString(p) msg := &PreAccept{} - if err := code_google_com_p_gogoprotobuf_proto1.UnmarshalText(data, msg); err != nil { + if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { panic(err) } if err := p.VerboseEqual(msg); err != nil { @@ -1090,9 +1090,9 @@ func TestPreAcceptProtoCompactText(t *testing2.T) { func TestPreAcceptOKProtoText(t *testing2.T) { popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) p := NewPopulatedPreAcceptOK(popr, true) - data := code_google_com_p_gogoprotobuf_proto1.MarshalTextString(p) + data := github_com_gogo_protobuf_proto1.MarshalTextString(p) msg := &PreAcceptOK{} - if err := code_google_com_p_gogoprotobuf_proto1.UnmarshalText(data, msg); err != nil { + if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { panic(err) } if err := p.VerboseEqual(msg); err != nil { @@ -1106,9 +1106,9 @@ func TestPreAcceptOKProtoText(t *testing2.T) { func TestPreAcceptOKProtoCompactText(t *testing2.T) { popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) p := NewPopulatedPreAcceptOK(popr, true) - data := code_google_com_p_gogoprotobuf_proto1.CompactTextString(p) + data := github_com_gogo_protobuf_proto1.CompactTextString(p) msg := &PreAcceptOK{} - if err := code_google_com_p_gogoprotobuf_proto1.UnmarshalText(data, msg); err != nil { + if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { panic(err) } if err := p.VerboseEqual(msg); err != nil { @@ -1122,9 +1122,9 @@ func TestPreAcceptOKProtoCompactText(t *testing2.T) { func TestPreAcceptReplyProtoText(t *testing2.T) { popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) p := NewPopulatedPreAcceptReply(popr, true) - data := code_google_com_p_gogoprotobuf_proto1.MarshalTextString(p) + data := github_com_gogo_protobuf_proto1.MarshalTextString(p) msg := &PreAcceptReply{} - if err := code_google_com_p_gogoprotobuf_proto1.UnmarshalText(data, msg); err != nil { + if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { panic(err) } if err := p.VerboseEqual(msg); err != nil { @@ -1138,9 +1138,9 @@ func TestPreAcceptReplyProtoText(t *testing2.T) { func TestPreAcceptReplyProtoCompactText(t *testing2.T) { popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) p := NewPopulatedPreAcceptReply(popr, true) - data := code_google_com_p_gogoprotobuf_proto1.CompactTextString(p) + data := github_com_gogo_protobuf_proto1.CompactTextString(p) msg := &PreAcceptReply{} - if err := code_google_com_p_gogoprotobuf_proto1.UnmarshalText(data, msg); err != nil { + if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { panic(err) } if err := p.VerboseEqual(msg); err != nil { @@ -1154,9 +1154,9 @@ func TestPreAcceptReplyProtoCompactText(t *testing2.T) { func TestAcceptProtoText(t *testing2.T) { popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) p := NewPopulatedAccept(popr, true) - data := code_google_com_p_gogoprotobuf_proto1.MarshalTextString(p) + data := github_com_gogo_protobuf_proto1.MarshalTextString(p) msg := &Accept{} - if err := code_google_com_p_gogoprotobuf_proto1.UnmarshalText(data, msg); err != nil { + if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { panic(err) } if err := p.VerboseEqual(msg); err != nil { @@ -1170,9 +1170,9 @@ func TestAcceptProtoText(t *testing2.T) { func TestAcceptProtoCompactText(t *testing2.T) { popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) p := NewPopulatedAccept(popr, true) - data := code_google_com_p_gogoprotobuf_proto1.CompactTextString(p) + data := github_com_gogo_protobuf_proto1.CompactTextString(p) msg := &Accept{} - if err := code_google_com_p_gogoprotobuf_proto1.UnmarshalText(data, msg); err != nil { + if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { panic(err) } if err := p.VerboseEqual(msg); err != nil { @@ -1186,9 +1186,9 @@ func TestAcceptProtoCompactText(t *testing2.T) { func TestAcceptReplyProtoText(t *testing2.T) { popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) p := NewPopulatedAcceptReply(popr, true) - data := code_google_com_p_gogoprotobuf_proto1.MarshalTextString(p) + data := github_com_gogo_protobuf_proto1.MarshalTextString(p) msg := &AcceptReply{} - if err := code_google_com_p_gogoprotobuf_proto1.UnmarshalText(data, msg); err != nil { + if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { panic(err) } if err := p.VerboseEqual(msg); err != nil { @@ -1202,9 +1202,9 @@ func TestAcceptReplyProtoText(t *testing2.T) { func TestAcceptReplyProtoCompactText(t *testing2.T) { popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) p := NewPopulatedAcceptReply(popr, true) - data := code_google_com_p_gogoprotobuf_proto1.CompactTextString(p) + data := github_com_gogo_protobuf_proto1.CompactTextString(p) msg := &AcceptReply{} - if err := code_google_com_p_gogoprotobuf_proto1.UnmarshalText(data, msg); err != nil { + if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { panic(err) } if err := p.VerboseEqual(msg); err != nil { @@ -1218,9 +1218,9 @@ func TestAcceptReplyProtoCompactText(t *testing2.T) { func TestPrepareProtoText(t *testing2.T) { popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) p := NewPopulatedPrepare(popr, true) - data := code_google_com_p_gogoprotobuf_proto1.MarshalTextString(p) + data := github_com_gogo_protobuf_proto1.MarshalTextString(p) msg := &Prepare{} - if err := code_google_com_p_gogoprotobuf_proto1.UnmarshalText(data, msg); err != nil { + if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { panic(err) } if err := p.VerboseEqual(msg); err != nil { @@ -1234,9 +1234,9 @@ func TestPrepareProtoText(t *testing2.T) { func TestPrepareProtoCompactText(t *testing2.T) { popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) p := NewPopulatedPrepare(popr, true) - data := code_google_com_p_gogoprotobuf_proto1.CompactTextString(p) + data := github_com_gogo_protobuf_proto1.CompactTextString(p) msg := &Prepare{} - if err := code_google_com_p_gogoprotobuf_proto1.UnmarshalText(data, msg); err != nil { + if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { panic(err) } if err := p.VerboseEqual(msg); err != nil { @@ -1250,9 +1250,9 @@ func TestPrepareProtoCompactText(t *testing2.T) { func TestPrepareReplyProtoText(t *testing2.T) { popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) p := NewPopulatedPrepareReply(popr, true) - data := code_google_com_p_gogoprotobuf_proto1.MarshalTextString(p) + data := github_com_gogo_protobuf_proto1.MarshalTextString(p) msg := &PrepareReply{} - if err := code_google_com_p_gogoprotobuf_proto1.UnmarshalText(data, msg); err != nil { + if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { panic(err) } if err := p.VerboseEqual(msg); err != nil { @@ -1266,9 +1266,9 @@ func TestPrepareReplyProtoText(t *testing2.T) { func TestPrepareReplyProtoCompactText(t *testing2.T) { popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) p := NewPopulatedPrepareReply(popr, true) - data := code_google_com_p_gogoprotobuf_proto1.CompactTextString(p) + data := github_com_gogo_protobuf_proto1.CompactTextString(p) msg := &PrepareReply{} - if err := code_google_com_p_gogoprotobuf_proto1.UnmarshalText(data, msg); err != nil { + if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { panic(err) } if err := p.VerboseEqual(msg); err != nil { @@ -1282,9 +1282,9 @@ func TestPrepareReplyProtoCompactText(t *testing2.T) { func TestCommitProtoText(t *testing2.T) { popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) p := NewPopulatedCommit(popr, true) - data := code_google_com_p_gogoprotobuf_proto1.MarshalTextString(p) + data := github_com_gogo_protobuf_proto1.MarshalTextString(p) msg := &Commit{} - if err := code_google_com_p_gogoprotobuf_proto1.UnmarshalText(data, msg); err != nil { + if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { panic(err) } if err := p.VerboseEqual(msg); err != nil { @@ -1298,9 +1298,9 @@ func TestCommitProtoText(t *testing2.T) { func TestCommitProtoCompactText(t *testing2.T) { popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) p := NewPopulatedCommit(popr, true) - data := code_google_com_p_gogoprotobuf_proto1.CompactTextString(p) + data := github_com_gogo_protobuf_proto1.CompactTextString(p) msg := &Commit{} - if err := code_google_com_p_gogoprotobuf_proto1.UnmarshalText(data, msg); err != nil { + if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { panic(err) } if err := p.VerboseEqual(msg); err != nil { @@ -1395,8 +1395,8 @@ func TestCommitStringer(t *testing3.T) { func TestBallotSize(t *testing4.T) { popr := math_rand4.New(math_rand4.NewSource(time4.Now().UnixNano())) p := NewPopulatedBallot(popr, true) - size2 := code_google_com_p_gogoprotobuf_proto2.Size(p) - data, err := code_google_com_p_gogoprotobuf_proto2.Marshal(p) + size2 := github_com_gogo_protobuf_proto2.Size(p) + data, err := github_com_gogo_protobuf_proto2.Marshal(p) if err != nil { panic(err) } @@ -1407,7 +1407,7 @@ func TestBallotSize(t *testing4.T) { if size2 != size { t.Fatalf("size %v != before marshal proto.Size %v", size, size2) } - size3 := code_google_com_p_gogoprotobuf_proto2.Size(p) + size3 := github_com_gogo_protobuf_proto2.Size(p) if size3 != size { t.Fatalf("size %v != after marshal proto.Size %v", size, size3) } @@ -1430,8 +1430,8 @@ func BenchmarkBallotSize(b *testing4.B) { func TestPreAcceptSize(t *testing4.T) { popr := math_rand4.New(math_rand4.NewSource(time4.Now().UnixNano())) p := NewPopulatedPreAccept(popr, true) - size2 := code_google_com_p_gogoprotobuf_proto2.Size(p) - data, err := code_google_com_p_gogoprotobuf_proto2.Marshal(p) + size2 := github_com_gogo_protobuf_proto2.Size(p) + data, err := github_com_gogo_protobuf_proto2.Marshal(p) if err != nil { panic(err) } @@ -1442,7 +1442,7 @@ func TestPreAcceptSize(t *testing4.T) { if size2 != size { t.Fatalf("size %v != before marshal proto.Size %v", size, size2) } - size3 := code_google_com_p_gogoprotobuf_proto2.Size(p) + size3 := github_com_gogo_protobuf_proto2.Size(p) if size3 != size { t.Fatalf("size %v != after marshal proto.Size %v", size, size3) } @@ -1465,8 +1465,8 @@ func BenchmarkPreAcceptSize(b *testing4.B) { func TestPreAcceptOKSize(t *testing4.T) { popr := math_rand4.New(math_rand4.NewSource(time4.Now().UnixNano())) p := NewPopulatedPreAcceptOK(popr, true) - size2 := code_google_com_p_gogoprotobuf_proto2.Size(p) - data, err := code_google_com_p_gogoprotobuf_proto2.Marshal(p) + size2 := github_com_gogo_protobuf_proto2.Size(p) + data, err := github_com_gogo_protobuf_proto2.Marshal(p) if err != nil { panic(err) } @@ -1477,7 +1477,7 @@ func TestPreAcceptOKSize(t *testing4.T) { if size2 != size { t.Fatalf("size %v != before marshal proto.Size %v", size, size2) } - size3 := code_google_com_p_gogoprotobuf_proto2.Size(p) + size3 := github_com_gogo_protobuf_proto2.Size(p) if size3 != size { t.Fatalf("size %v != after marshal proto.Size %v", size, size3) } @@ -1500,8 +1500,8 @@ func BenchmarkPreAcceptOKSize(b *testing4.B) { func TestPreAcceptReplySize(t *testing4.T) { popr := math_rand4.New(math_rand4.NewSource(time4.Now().UnixNano())) p := NewPopulatedPreAcceptReply(popr, true) - size2 := code_google_com_p_gogoprotobuf_proto2.Size(p) - data, err := code_google_com_p_gogoprotobuf_proto2.Marshal(p) + size2 := github_com_gogo_protobuf_proto2.Size(p) + data, err := github_com_gogo_protobuf_proto2.Marshal(p) if err != nil { panic(err) } @@ -1512,7 +1512,7 @@ func TestPreAcceptReplySize(t *testing4.T) { if size2 != size { t.Fatalf("size %v != before marshal proto.Size %v", size, size2) } - size3 := code_google_com_p_gogoprotobuf_proto2.Size(p) + size3 := github_com_gogo_protobuf_proto2.Size(p) if size3 != size { t.Fatalf("size %v != after marshal proto.Size %v", size, size3) } @@ -1535,8 +1535,8 @@ func BenchmarkPreAcceptReplySize(b *testing4.B) { func TestAcceptSize(t *testing4.T) { popr := math_rand4.New(math_rand4.NewSource(time4.Now().UnixNano())) p := NewPopulatedAccept(popr, true) - size2 := code_google_com_p_gogoprotobuf_proto2.Size(p) - data, err := code_google_com_p_gogoprotobuf_proto2.Marshal(p) + size2 := github_com_gogo_protobuf_proto2.Size(p) + data, err := github_com_gogo_protobuf_proto2.Marshal(p) if err != nil { panic(err) } @@ -1547,7 +1547,7 @@ func TestAcceptSize(t *testing4.T) { if size2 != size { t.Fatalf("size %v != before marshal proto.Size %v", size, size2) } - size3 := code_google_com_p_gogoprotobuf_proto2.Size(p) + size3 := github_com_gogo_protobuf_proto2.Size(p) if size3 != size { t.Fatalf("size %v != after marshal proto.Size %v", size, size3) } @@ -1570,8 +1570,8 @@ func BenchmarkAcceptSize(b *testing4.B) { func TestAcceptReplySize(t *testing4.T) { popr := math_rand4.New(math_rand4.NewSource(time4.Now().UnixNano())) p := NewPopulatedAcceptReply(popr, true) - size2 := code_google_com_p_gogoprotobuf_proto2.Size(p) - data, err := code_google_com_p_gogoprotobuf_proto2.Marshal(p) + size2 := github_com_gogo_protobuf_proto2.Size(p) + data, err := github_com_gogo_protobuf_proto2.Marshal(p) if err != nil { panic(err) } @@ -1582,7 +1582,7 @@ func TestAcceptReplySize(t *testing4.T) { if size2 != size { t.Fatalf("size %v != before marshal proto.Size %v", size, size2) } - size3 := code_google_com_p_gogoprotobuf_proto2.Size(p) + size3 := github_com_gogo_protobuf_proto2.Size(p) if size3 != size { t.Fatalf("size %v != after marshal proto.Size %v", size, size3) } @@ -1605,8 +1605,8 @@ func BenchmarkAcceptReplySize(b *testing4.B) { func TestPrepareSize(t *testing4.T) { popr := math_rand4.New(math_rand4.NewSource(time4.Now().UnixNano())) p := NewPopulatedPrepare(popr, true) - size2 := code_google_com_p_gogoprotobuf_proto2.Size(p) - data, err := code_google_com_p_gogoprotobuf_proto2.Marshal(p) + size2 := github_com_gogo_protobuf_proto2.Size(p) + data, err := github_com_gogo_protobuf_proto2.Marshal(p) if err != nil { panic(err) } @@ -1617,7 +1617,7 @@ func TestPrepareSize(t *testing4.T) { if size2 != size { t.Fatalf("size %v != before marshal proto.Size %v", size, size2) } - size3 := code_google_com_p_gogoprotobuf_proto2.Size(p) + size3 := github_com_gogo_protobuf_proto2.Size(p) if size3 != size { t.Fatalf("size %v != after marshal proto.Size %v", size, size3) } @@ -1640,8 +1640,8 @@ func BenchmarkPrepareSize(b *testing4.B) { func TestPrepareReplySize(t *testing4.T) { popr := math_rand4.New(math_rand4.NewSource(time4.Now().UnixNano())) p := NewPopulatedPrepareReply(popr, true) - size2 := code_google_com_p_gogoprotobuf_proto2.Size(p) - data, err := code_google_com_p_gogoprotobuf_proto2.Marshal(p) + size2 := github_com_gogo_protobuf_proto2.Size(p) + data, err := github_com_gogo_protobuf_proto2.Marshal(p) if err != nil { panic(err) } @@ -1652,7 +1652,7 @@ func TestPrepareReplySize(t *testing4.T) { if size2 != size { t.Fatalf("size %v != before marshal proto.Size %v", size, size2) } - size3 := code_google_com_p_gogoprotobuf_proto2.Size(p) + size3 := github_com_gogo_protobuf_proto2.Size(p) if size3 != size { t.Fatalf("size %v != after marshal proto.Size %v", size, size3) } @@ -1675,8 +1675,8 @@ func BenchmarkPrepareReplySize(b *testing4.B) { func TestCommitSize(t *testing4.T) { popr := math_rand4.New(math_rand4.NewSource(time4.Now().UnixNano())) p := NewPopulatedCommit(popr, true) - size2 := code_google_com_p_gogoprotobuf_proto2.Size(p) - data, err := code_google_com_p_gogoprotobuf_proto2.Marshal(p) + size2 := github_com_gogo_protobuf_proto2.Size(p) + data, err := github_com_gogo_protobuf_proto2.Marshal(p) if err != nil { panic(err) } @@ -1687,7 +1687,7 @@ func TestCommitSize(t *testing4.T) { if size2 != size { t.Fatalf("size %v != before marshal proto.Size %v", size, size2) } - size3 := code_google_com_p_gogoprotobuf_proto2.Size(p) + size3 := github_com_gogo_protobuf_proto2.Size(p) if size3 != size { t.Fatalf("size %v != after marshal proto.Size %v", size, size3) } @@ -1827,12 +1827,12 @@ func TestCommitGoString(t *testing5.T) { func TestBallotVerboseEqual(t *testing6.T) { popr := math_rand6.New(math_rand6.NewSource(time6.Now().UnixNano())) p := NewPopulatedBallot(popr, false) - data, err := code_google_com_p_gogoprotobuf_proto3.Marshal(p) + data, err := github_com_gogo_protobuf_proto3.Marshal(p) if err != nil { panic(err) } msg := &Ballot{} - if err := code_google_com_p_gogoprotobuf_proto3.Unmarshal(data, msg); err != nil { + if err := github_com_gogo_protobuf_proto3.Unmarshal(data, msg); err != nil { panic(err) } if err := p.VerboseEqual(msg); err != nil { @@ -1842,12 +1842,12 @@ func TestBallotVerboseEqual(t *testing6.T) { func TestPreAcceptVerboseEqual(t *testing6.T) { popr := math_rand6.New(math_rand6.NewSource(time6.Now().UnixNano())) p := NewPopulatedPreAccept(popr, false) - data, err := code_google_com_p_gogoprotobuf_proto3.Marshal(p) + data, err := github_com_gogo_protobuf_proto3.Marshal(p) if err != nil { panic(err) } msg := &PreAccept{} - if err := code_google_com_p_gogoprotobuf_proto3.Unmarshal(data, msg); err != nil { + if err := github_com_gogo_protobuf_proto3.Unmarshal(data, msg); err != nil { panic(err) } if err := p.VerboseEqual(msg); err != nil { @@ -1857,12 +1857,12 @@ func TestPreAcceptVerboseEqual(t *testing6.T) { func TestPreAcceptOKVerboseEqual(t *testing6.T) { popr := math_rand6.New(math_rand6.NewSource(time6.Now().UnixNano())) p := NewPopulatedPreAcceptOK(popr, false) - data, err := code_google_com_p_gogoprotobuf_proto3.Marshal(p) + data, err := github_com_gogo_protobuf_proto3.Marshal(p) if err != nil { panic(err) } msg := &PreAcceptOK{} - if err := code_google_com_p_gogoprotobuf_proto3.Unmarshal(data, msg); err != nil { + if err := github_com_gogo_protobuf_proto3.Unmarshal(data, msg); err != nil { panic(err) } if err := p.VerboseEqual(msg); err != nil { @@ -1872,12 +1872,12 @@ func TestPreAcceptOKVerboseEqual(t *testing6.T) { func TestPreAcceptReplyVerboseEqual(t *testing6.T) { popr := math_rand6.New(math_rand6.NewSource(time6.Now().UnixNano())) p := NewPopulatedPreAcceptReply(popr, false) - data, err := code_google_com_p_gogoprotobuf_proto3.Marshal(p) + data, err := github_com_gogo_protobuf_proto3.Marshal(p) if err != nil { panic(err) } msg := &PreAcceptReply{} - if err := code_google_com_p_gogoprotobuf_proto3.Unmarshal(data, msg); err != nil { + if err := github_com_gogo_protobuf_proto3.Unmarshal(data, msg); err != nil { panic(err) } if err := p.VerboseEqual(msg); err != nil { @@ -1887,12 +1887,12 @@ func TestPreAcceptReplyVerboseEqual(t *testing6.T) { func TestAcceptVerboseEqual(t *testing6.T) { popr := math_rand6.New(math_rand6.NewSource(time6.Now().UnixNano())) p := NewPopulatedAccept(popr, false) - data, err := code_google_com_p_gogoprotobuf_proto3.Marshal(p) + data, err := github_com_gogo_protobuf_proto3.Marshal(p) if err != nil { panic(err) } msg := &Accept{} - if err := code_google_com_p_gogoprotobuf_proto3.Unmarshal(data, msg); err != nil { + if err := github_com_gogo_protobuf_proto3.Unmarshal(data, msg); err != nil { panic(err) } if err := p.VerboseEqual(msg); err != nil { @@ -1902,12 +1902,12 @@ func TestAcceptVerboseEqual(t *testing6.T) { func TestAcceptReplyVerboseEqual(t *testing6.T) { popr := math_rand6.New(math_rand6.NewSource(time6.Now().UnixNano())) p := NewPopulatedAcceptReply(popr, false) - data, err := code_google_com_p_gogoprotobuf_proto3.Marshal(p) + data, err := github_com_gogo_protobuf_proto3.Marshal(p) if err != nil { panic(err) } msg := &AcceptReply{} - if err := code_google_com_p_gogoprotobuf_proto3.Unmarshal(data, msg); err != nil { + if err := github_com_gogo_protobuf_proto3.Unmarshal(data, msg); err != nil { panic(err) } if err := p.VerboseEqual(msg); err != nil { @@ -1917,12 +1917,12 @@ func TestAcceptReplyVerboseEqual(t *testing6.T) { func TestPrepareVerboseEqual(t *testing6.T) { popr := math_rand6.New(math_rand6.NewSource(time6.Now().UnixNano())) p := NewPopulatedPrepare(popr, false) - data, err := code_google_com_p_gogoprotobuf_proto3.Marshal(p) + data, err := github_com_gogo_protobuf_proto3.Marshal(p) if err != nil { panic(err) } msg := &Prepare{} - if err := code_google_com_p_gogoprotobuf_proto3.Unmarshal(data, msg); err != nil { + if err := github_com_gogo_protobuf_proto3.Unmarshal(data, msg); err != nil { panic(err) } if err := p.VerboseEqual(msg); err != nil { @@ -1932,12 +1932,12 @@ func TestPrepareVerboseEqual(t *testing6.T) { func TestPrepareReplyVerboseEqual(t *testing6.T) { popr := math_rand6.New(math_rand6.NewSource(time6.Now().UnixNano())) p := NewPopulatedPrepareReply(popr, false) - data, err := code_google_com_p_gogoprotobuf_proto3.Marshal(p) + data, err := github_com_gogo_protobuf_proto3.Marshal(p) if err != nil { panic(err) } msg := &PrepareReply{} - if err := code_google_com_p_gogoprotobuf_proto3.Unmarshal(data, msg); err != nil { + if err := github_com_gogo_protobuf_proto3.Unmarshal(data, msg); err != nil { panic(err) } if err := p.VerboseEqual(msg); err != nil { @@ -1947,12 +1947,12 @@ func TestPrepareReplyVerboseEqual(t *testing6.T) { func TestCommitVerboseEqual(t *testing6.T) { popr := math_rand6.New(math_rand6.NewSource(time6.Now().UnixNano())) p := NewPopulatedCommit(popr, false) - data, err := code_google_com_p_gogoprotobuf_proto3.Marshal(p) + data, err := github_com_gogo_protobuf_proto3.Marshal(p) if err != nil { panic(err) } msg := &Commit{} - if err := code_google_com_p_gogoprotobuf_proto3.Unmarshal(data, msg); err != nil { + if err := github_com_gogo_protobuf_proto3.Unmarshal(data, msg); err != nil { panic(err) } if err := p.VerboseEqual(msg); err != nil { @@ -1960,4 +1960,4 @@ func TestCommitVerboseEqual(t *testing6.T) { } } -//These tests are generated by code.google.com/p/gogoprotobuf/plugin/testgen +//These tests are generated by github.com/gogo/protobuf/plugin/testgen diff --git a/replica/instance.go b/replica/instance.go index bcccc45..43fad87 100644 --- a/replica/instance.go +++ b/replica/instance.go @@ -29,7 +29,7 @@ import ( "fmt" "time" - "github.com/go-distributed/epaxos/message" + "github.com/sargun/epaxos/message" ) // **************************** diff --git a/replica/instance_test.go b/replica/instance_test.go index 83a75a2..d1720a3 100644 --- a/replica/instance_test.go +++ b/replica/instance_test.go @@ -4,9 +4,9 @@ import ( "fmt" "testing" - "github.com/go-distributed/epaxos/message" - "github.com/go-distributed/epaxos/test" - "github.com/go-distributed/epaxos/transporter" + "github.com/sargun/epaxos/message" + "github.com/sargun/epaxos/test" + "github.com/sargun/epaxos/transporter" "github.com/stretchr/testify/assert" ) @@ -42,6 +42,7 @@ func commonTestlibExampleReplica() *Replica { Size: 5, StateMachine: new(test.DummySM), Transporter: transporter.NewDummyTR(0, 5), + PersistentPath: tempfile(), } r, _ := New(param) return r @@ -53,6 +54,7 @@ func commonTestlibExampleInstance() *Instance { Size: 5, StateMachine: new(test.DummySM), Transporter: transporter.NewDummyTR(0, 5), + PersistentPath: tempfile(), } r, err := New(param) if err != nil { @@ -156,6 +158,7 @@ func TestNewInstance(t *testing.T) { Size: 5, StateMachine: new(test.DummySM), Transporter: transporter.NewDummyTR(expectedReplicaId, 5), + PersistentPath: tempfile(), } r, _ := New(param) i := NewInstance(r, expectedReplicaId, expectedInstanceId) diff --git a/replica/registry.go b/replica/registry.go index 26d834b..93887cc 100644 --- a/replica/registry.go +++ b/replica/registry.go @@ -4,7 +4,7 @@ import ( "fmt" "reflect" - "github.com/go-distributed/epaxos/message" + "github.com/sargun/epaxos/message" ) var registry map[uint8]reflect.Type diff --git a/replica/replica.go b/replica/replica.go index cd209cf..0a096ae 100644 --- a/replica/replica.go +++ b/replica/replica.go @@ -20,9 +20,9 @@ import ( "sort" "time" - "github.com/go-distributed/epaxos" - "github.com/go-distributed/epaxos/message" - "github.com/go-distributed/epaxos/persistent" + "github.com/sargun/epaxos" + "github.com/sargun/epaxos/message" + "github.com/sargun/epaxos/persistent" "github.com/golang/glog" ) @@ -115,7 +115,7 @@ type Replica struct { // persistent store enablePersistent bool - store *persistent.LevelDB + store persistent.DB } type Param struct { @@ -212,16 +212,13 @@ func New(param *Param) (*Replica, error) { enablePersistent: param.EnablePersistent, } - var path string if param.PersistentPath == "" { - path = fmt.Sprintf("%s-%d", "/dev/shm/test", r.Id) - } else { - path = param.PersistentPath + panic("Persistent path not set") } - r.store, err = persistent.NewLevelDB(path, param.Restore) + r.store, err = persistent.NewBoltDB(param.PersistentPath, param.Restore) if err != nil { - glog.Errorln("replica.New: failed to make new storage") + glog.Errorln("replica.New: failed to make new storage: ", err) return nil, err } @@ -261,7 +258,9 @@ func (r *Replica) Start() error { func (r *Replica) stopTickers() { r.executeTicker.Stop() r.timeoutTicker.Stop() - r.proposeTicker.Stop() + if r.enableBatching { + r.proposeTicker.Stop() + } } func (r *Replica) Stop() { diff --git a/replica/replica_test.go b/replica/replica_test.go index 306b930..77f5be0 100644 --- a/replica/replica_test.go +++ b/replica/replica_test.go @@ -5,11 +5,13 @@ import ( "testing" "time" - "github.com/go-distributed/epaxos" - "github.com/go-distributed/epaxos/message" - "github.com/go-distributed/epaxos/test" - "github.com/go-distributed/epaxos/transporter" + "github.com/sargun/epaxos" + "github.com/sargun/epaxos/message" + "github.com/sargun/epaxos/test" + "github.com/sargun/epaxos/transporter" "github.com/stretchr/testify/assert" + "io/ioutil" + "os" ) var _ = fmt.Printf @@ -20,6 +22,7 @@ func TestNewReplica(t *testing.T) { Size: 5, StateMachine: new(test.DummySM), Transporter: transporter.NewDummyTR(3, 5), + PersistentPath: tempfile(), } r, _ := New(param) @@ -45,6 +48,7 @@ func TestMakeInitialBallot(t *testing.T) { Size: 5, StateMachine: new(test.DummySM), Transporter: transporter.NewDummyTR(3, 5), + PersistentPath: tempfile(), } r, _ := New(param) r.Epoch = 3 @@ -59,6 +63,7 @@ func depsTestSetupReplica() (r *Replica, i *Instance) { Size: 5, StateMachine: new(test.DummySM), Transporter: transporter.NewDummyTR(4, 5), + PersistentPath: tempfile(), } r, _ = New(param) for i := 0; i < 5; i++ { @@ -650,6 +655,7 @@ func TestProposeIdNoBatch(t *testing.T) { StateMachine: new(test.DummySM), EnableBatching: false, Transporter: transporter.NewDummyTR(0, 5), + PersistentPath: tempfile(), } r, _ := New(param) @@ -688,6 +694,7 @@ func TestProposeIdWithBatch(t *testing.T) { EnableBatching: true, BatchInterval: time.Millisecond * 50, Transporter: transporter.NewDummyTR(0, 5), + PersistentPath: tempfile(), } r, _ := New(param) @@ -727,6 +734,7 @@ func TestStoreSingleInstance(t *testing.T) { EnableBatching: true, BatchInterval: time.Millisecond * 50, Transporter: transporter.NewDummyTR(0, 5), + PersistentPath: tempfile(), } r, err := New(param) assert.NoError(t, err) @@ -747,6 +755,7 @@ func TestStoreRestoreSingleInstance(t *testing.T) { EnableBatching: true, BatchInterval: time.Millisecond * 50, Transporter: transporter.NewDummyTR(0, 5), + PersistentPath: tempfile(), } r, err := New(param) assert.NoError(t, err) @@ -775,6 +784,7 @@ func TestStoreRestoreSinglePreparingInstance(t *testing.T) { EnableBatching: true, BatchInterval: time.Millisecond * 50, Transporter: transporter.NewDummyTR(0, 5), + PersistentPath: tempfile(), } r, err := New(param) assert.NoError(t, err) @@ -808,6 +818,7 @@ func TestStoreRestoreMultipleInstances(t *testing.T) { EnableBatching: true, BatchInterval: time.Millisecond * 50, Transporter: transporter.NewDummyTR(0, 5), + PersistentPath: tempfile(), } r, err := New(param) assert.NoError(t, err) @@ -856,6 +867,7 @@ func TestStoreAndRestoreReplica(t *testing.T) { EnableBatching: true, BatchInterval: time.Millisecond * 50, Transporter: transporter.NewDummyTR(0, 5), + PersistentPath: tempfile(), } r, err := New(param) assert.NoError(t, err) @@ -873,6 +885,10 @@ func TestStoreAndRestoreReplica(t *testing.T) { // store to disk assert.NoError(t, r.StoreReplica()) + // Shutdown replica -- BoltDB enforces one process per database + // In fact I have no idea idea how this worked with LevelDB + r.Stop() + // restore from disk param.Restore = true rr, err := New(param) @@ -887,3 +903,11 @@ func TestStoreAndRestoreReplica(t *testing.T) { r.store.Drop() rr.store.Drop() } + +// Borrowed from: https://github.com/boltdb/bolt/blob/2f4ba1c5331c044ed8c2743b791d5bedf0efa54b/db_test.go#L30-L38 +func tempfile() string { + f, _ := ioutil.TempFile("", "bolt-") + f.Close() + os.Remove(f.Name()) + return f.Name() +} diff --git a/statemachine.go b/statemachine.go index 1c9bdca..9cdd118 100644 --- a/statemachine.go +++ b/statemachine.go @@ -3,7 +3,7 @@ package epaxos import ( "errors" - "github.com/go-distributed/epaxos/message" + "github.com/sargun/epaxos/message" ) var ( diff --git a/test.sh b/test.sh index f5664d6..1ddd1a4 100755 --- a/test.sh +++ b/test.sh @@ -4,7 +4,7 @@ rm /dev/shm/demo* -fr rm /tmp/*test* -fr -ROOT=$GOPATH/src/github.com/go-distributed/epaxos +ROOT=$GOPATH/src/github.com/sargun/epaxos cd $ROOT echo "======= Basic Message/Data Test ======" diff --git a/test/dummySM.go b/test/dummySM.go index 973cbd2..d3378f8 100644 --- a/test/dummySM.go +++ b/test/dummySM.go @@ -3,8 +3,8 @@ package test import ( "bytes" - "github.com/go-distributed/epaxos" - "github.com/go-distributed/epaxos/message" + "github.com/sargun/epaxos" + "github.com/sargun/epaxos/message" ) type DummySM struct { diff --git a/transporter.go b/transporter.go index ff20cfe..53629d3 100644 --- a/transporter.go +++ b/transporter.go @@ -1,7 +1,7 @@ package epaxos import ( - "github.com/go-distributed/epaxos/message" + "github.com/sargun/epaxos/message" ) type Transporter interface { diff --git a/transporter/dummy_transporter.go b/transporter/dummy_transporter.go index c4b4855..cbda8e1 100644 --- a/transporter/dummy_transporter.go +++ b/transporter/dummy_transporter.go @@ -1,7 +1,7 @@ package transporter import ( - "github.com/go-distributed/epaxos/message" + "github.com/sargun/epaxos/message" ) type DummyTransporter struct { diff --git a/transporter/udp_transporter.go b/transporter/udp_transporter.go index 753c831..2d06bb6 100644 --- a/transporter/udp_transporter.go +++ b/transporter/udp_transporter.go @@ -6,7 +6,7 @@ import ( "math/rand" "net" - "github.com/go-distributed/epaxos/message" + "github.com/sargun/epaxos/message" "github.com/golang/glog" )