Skip to content

Commit ec26cd8

Browse files
committed
goimports and govet fixes
Change-Id: Ia0dcd58b57be91f6dcd1117de7f903ed57922065 Signed-off-by: Yacov Manevich <[email protected]>
1 parent 6f9b427 commit ec26cd8

File tree

13 files changed

+17
-21
lines changed

13 files changed

+17
-21
lines changed

consensus/executor/executor.go

-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ import (
2121
"github.com/hyperledger/fabric/consensus/util/events"
2222
"github.com/hyperledger/fabric/core/peer/statetransfer"
2323
pb "github.com/hyperledger/fabric/protos"
24-
2524
"github.com/op/go-logging"
2625
)
2726

consensus/executor/executor_test.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,9 @@ import (
2222
"testing"
2323

2424
"github.com/hyperledger/fabric/consensus/util/events"
25+
"github.com/op/go-logging"
2526

2627
pb "github.com/hyperledger/fabric/protos"
27-
28-
"github.com/op/go-logging"
2928
)
3029

3130
func init() {

consensus/pbft/batch.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@ import (
2323
"github.com/hyperledger/fabric/consensus"
2424
"github.com/hyperledger/fabric/consensus/util/events"
2525
pb "github.com/hyperledger/fabric/protos"
26+
"github.com/op/go-logging"
2627

2728
"github.com/golang/protobuf/proto"
2829
"github.com/golang/protobuf/ptypes/timestamp"
29-
"github.com/op/go-logging"
3030
"github.com/spf13/viper"
3131
)
3232

consensus/util/messagefan.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,8 @@ package util
1919
import (
2020
"sync"
2121

22-
"github.com/op/go-logging"
23-
2422
pb "github.com/hyperledger/fabric/protos"
23+
"github.com/op/go-logging"
2524
)
2625

2726
var logger *logging.Logger // package-level logger

core/committer/noopssinglechain/committer.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ func (r *deliverClient) readUntilClose() {
146146
if err = r.commit(txs); err != nil {
147147
fmt.Printf("Got error while committing(%s)\n", err)
148148
} else {
149-
fmt.Printf("Commit success, created a block!\n", err)
149+
fmt.Printf("Commit success, created a block!\n")
150150
}
151151

152152
r.unAcknowledged++

core/ledger/test/ledger_suite_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ import (
2222

2323
. "github.com/onsi/ginkgo"
2424
. "github.com/onsi/gomega"
25+
"github.com/op/go-logging"
2526

2627
"github.com/hyperledger/fabric/core/db"
2728
"github.com/hyperledger/fabric/core/ledger"
28-
"github.com/op/go-logging"
2929
"github.com/spf13/viper"
3030
)
3131

core/peer/statetransfer/statetransfer.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,11 @@ import (
2424
"time"
2525

2626
_ "github.com/hyperledger/fabric/core" // Logging format init
27+
"github.com/op/go-logging"
2728

2829
"github.com/hyperledger/fabric/core/ledger/statemgmt"
2930
"github.com/hyperledger/fabric/core/peer"
3031
pb "github.com/hyperledger/fabric/protos"
31-
"github.com/op/go-logging"
3232
"github.com/spf13/viper"
3333
)
3434

core/peer/statetransfer/statetransfer_test.go

-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ import (
2828
configSetup "github.com/hyperledger/fabric/core/config"
2929
"github.com/hyperledger/fabric/core/peer"
3030
"github.com/hyperledger/fabric/protos"
31-
3231
"github.com/op/go-logging"
3332
)
3433

membersrvc/ca/ecap.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,12 @@ import (
2929
"time"
3030

3131
"github.com/hyperledger/fabric/core/crypto/primitives/ecies"
32+
"github.com/op/go-logging"
3233

3334
"github.com/golang/protobuf/proto"
3435
"github.com/golang/protobuf/ptypes/timestamp"
3536
"github.com/hyperledger/fabric/core/crypto/primitives"
3637
pb "github.com/hyperledger/fabric/membersrvc/protos"
37-
"github.com/op/go-logging"
3838
"github.com/spf13/viper"
3939
"golang.org/x/net/context"
4040
)

orderer/sample_clients/broadcast_timestamp/client.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ func newBroadcastClient(client ab.AtomicBroadcast_BroadcastClient) *broadcastCli
3636
}
3737

3838
func (s *broadcastClient) broadcast(transaction []byte) error {
39-
return s.client.Send(&ab.BroadcastMessage{transaction})
39+
return s.client.Send(&ab.BroadcastMessage{Data: transaction})
4040
}
4141

4242
func main() {

orderer/solo/broadcast.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -124,17 +124,17 @@ func (b *broadcaster) queueBroadcastMessages(srv ab.AtomicBroadcast_BroadcastSer
124124
}
125125

126126
if msg.Data == nil {
127-
err = srv.Send(&ab.BroadcastResponse{ab.Status_BAD_REQUEST})
127+
err = srv.Send(&ab.BroadcastResponse{Status: ab.Status_BAD_REQUEST})
128128
if err != nil {
129129
return err
130130
}
131131
}
132132

133133
select {
134134
case b.queue <- msg:
135-
err = srv.Send(&ab.BroadcastResponse{ab.Status_SUCCESS})
135+
err = srv.Send(&ab.BroadcastResponse{Status: ab.Status_SUCCESS})
136136
default:
137-
err = srv.Send(&ab.BroadcastResponse{ab.Status_SERVICE_UNAVAILABLE})
137+
err = srv.Send(&ab.BroadcastResponse{Status: ab.Status_SERVICE_UNAVAILABLE})
138138
}
139139

140140
if err != nil {

orderer/solo/broadcast_test.go

+5-5
Original file line numberDiff line numberDiff line change
@@ -64,14 +64,14 @@ func TestQueueOverflow(t *testing.T) {
6464
bs.halt()
6565

6666
for i := 0; i < 2; i++ {
67-
m.recvChan <- &ab.BroadcastMessage{[]byte("Some bytes")}
67+
m.recvChan <- &ab.BroadcastMessage{Data: []byte("Some bytes")}
6868
reply := <-m.sendChan
6969
if reply.Status != ab.Status_SUCCESS {
7070
t.Fatalf("Should have successfully queued the message")
7171
}
7272
}
7373

74-
m.recvChan <- &ab.BroadcastMessage{[]byte("Some bytes")}
74+
m.recvChan <- &ab.BroadcastMessage{Data: []byte("Some bytes")}
7575
reply := <-m.sendChan
7676
if reply.Status != ab.Status_SERVICE_UNAVAILABLE {
7777
t.Fatalf("Should not have successfully queued the message")
@@ -92,7 +92,7 @@ func TestMultiQueueOverflow(t *testing.T) {
9292

9393
for _, m := range ms {
9494
for i := 0; i < 2; i++ {
95-
m.recvChan <- &ab.BroadcastMessage{[]byte("Some bytes")}
95+
m.recvChan <- &ab.BroadcastMessage{Data: []byte("Some bytes")}
9696
reply := <-m.sendChan
9797
if reply.Status != ab.Status_SUCCESS {
9898
t.Fatalf("Should have successfully queued the message")
@@ -101,7 +101,7 @@ func TestMultiQueueOverflow(t *testing.T) {
101101
}
102102

103103
for _, m := range ms {
104-
m.recvChan <- &ab.BroadcastMessage{[]byte("Some bytes")}
104+
m.recvChan <- &ab.BroadcastMessage{Data: []byte("Some bytes")}
105105
reply := <-m.sendChan
106106
if reply.Status != ab.Status_SERVICE_UNAVAILABLE {
107107
t.Fatalf("Should not have successfully queued the message")
@@ -137,7 +137,7 @@ func TestFilledBatch(t *testing.T) {
137137
defer bs.halt()
138138
messages := 11 // Sending 11 messages, with a batch size of 2, ensures the 10th message is processed before we proceed for 5 blocks
139139
for i := 0; i < messages; i++ {
140-
bs.sendChan <- &ab.BroadcastMessage{[]byte("Some bytes")}
140+
bs.sendChan <- &ab.BroadcastMessage{Data: []byte("Some bytes")}
141141
}
142142
expected := uint64(1 + messages/batchSize)
143143
if bs.rl.(rawledger.Reader).Height() != expected {

peer/chaincode/noopsordererclient.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ func newBroadcastClient(client ab.AtomicBroadcast_BroadcastClient) *broadcastCli
4040
}
4141

4242
func (s *broadcastClient) broadcast(transaction []byte) error {
43-
return s.client.Send(&ab.BroadcastMessage{transaction})
43+
return s.client.Send(&ab.BroadcastMessage{Data: transaction})
4444
}
4545

4646
//Send data to solo orderer

0 commit comments

Comments
 (0)