Skip to content
This repository was archived by the owner on Apr 25, 2025. It is now read-only.

Commit 31fb7c4

Browse files
committed
Fix lint errors
Signed-off-by: Jim Zhang <jim.zhang@kaleido.io>
1 parent 92bc40a commit 31fb7c4

File tree

8 files changed

+26
-23
lines changed

8 files changed

+26
-23
lines changed

Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ DOCKER_CMD ?= docker
2525
DOCKER_COMPOSE_CMD ?= docker-compose
2626

2727
# Fabric versions used in the Makefile
28-
FABRIC_STABLE_VERSION := 2.2.0
29-
FABRIC_STABLE_VERSION_MINOR := 2.2
28+
FABRIC_STABLE_VERSION := 2.4.3
29+
FABRIC_STABLE_VERSION_MINOR := 2.4
3030
FABRIC_STABLE_VERSION_MAJOR := 2
3131

3232
FABRIC_PRERELEASE_VERSION :=
@@ -114,7 +114,7 @@ CC_MODE_LSCC = lscc
114114

115115
# Local variables used by makefile
116116
PROJECT_NAME := fabric-sdk-go
117-
ARCH := $(shell uname -m)
117+
ARCH := amd64
118118
OS_NAME := $(shell uname -s)
119119
FIXTURE_PROJECT_NAME := fabsdkgo
120120
MAKEFILE_THIS := $(lastword $(MAKEFILE_LIST))

pkg/client/channel/chclientrun_std.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
//go:build !pprof
12
// +build !pprof
23

34
/*

pkg/client/event/event.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,13 @@ type Client struct {
3333
permitBlockEvents bool
3434
fromBlock uint64
3535
seekType seek.Type
36-
chaincodeId string
36+
chaincodeID string
3737
eventConsumerTimeout *time.Duration
3838
}
3939

4040
// New returns a Client instance. Client receives events such as block, filtered block,
4141
// chaincode, and transaction status events.
42+
// nolint: gocyclo
4243
func New(channelProvider context.ChannelProvider, opts ...ClientOption) (*Client, error) {
4344

4445
channelContext, err := channelProvider()
@@ -69,8 +70,8 @@ func New(channelProvider context.ChannelProvider, opts ...ClientOption) (*Client
6970
opts = append(opts, deliverclient.WithBlockNum(eventClient.fromBlock))
7071
}
7172
}
72-
if eventClient.chaincodeId != "" {
73-
opts = append(opts, deliverclient.WithChaincodeId(eventClient.chaincodeId))
73+
if eventClient.chaincodeID != "" {
74+
opts = append(opts, deliverclient.WithChaincodeID(eventClient.chaincodeID))
7475
}
7576
if eventClient.eventConsumerTimeout != nil {
7677
opts = append(opts, dispatcher.WithEventConsumerTimeout(*eventClient.eventConsumerTimeout))

pkg/client/event/example_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ func ExampleClient_RegisterChaincodeEvent() {
7979

8080
func ExampleClient_RegisterChaincodeEvent_NewService() {
8181

82-
ec, err := New(mockChannelProvider("mychannel"), WithChaincodeId("examplecc"))
82+
ec, err := New(mockChannelProvider("mychannel"), WithChaincodeID("examplecc"))
8383
if err != nil {
8484
fmt.Println("failed to create client")
8585
}

pkg/client/event/opts.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,11 @@ func WithSeekType(seek seek.Type) ClientOption {
4242
}
4343
}
4444

45-
// WithChaincodeId indicates the target chaincode
45+
// WithChaincodeID indicates the target chaincode
4646
// Only deliverclient supports this
47-
func WithChaincodeId(id string) ClientOption {
47+
func WithChaincodeID(id string) ClientOption {
4848
return func(c *Client) error {
49-
c.chaincodeId = id
49+
c.chaincodeID = id
5050
return nil
5151
}
5252
}

pkg/fab/events/deliverclient/opts.go

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ type params struct {
1919
connProvider api.ConnectionProvider
2020
seekType seek.Type
2121
fromBlock uint64
22-
chaincodeId string
22+
chaincodeID string
2323
respTimeout time.Duration
2424
}
2525

@@ -49,11 +49,11 @@ func WithBlockNum(value uint64) options.Opt {
4949
}
5050
}
5151

52-
// WithChaincodeId specifies the chaincode from which events are to be received.
53-
func WithChaincodeId(value string) options.Opt {
52+
// WithChaincodeID specifies the chaincode from which events are to be received.
53+
func WithChaincodeID(value string) options.Opt {
5454
return func(p options.Params) {
55-
if setter, ok := p.(chaincodeIdSetter); ok {
56-
setter.SetChaincodeId(value)
55+
if setter, ok := p.(chaincodeIDSetter); ok {
56+
setter.SetChaincodeID(value)
5757
}
5858
}
5959
}
@@ -66,8 +66,8 @@ type fromBlockSetter interface {
6666
SetFromBlock(value uint64)
6767
}
6868

69-
type chaincodeIdSetter interface {
70-
SetChaincodeId(value string)
69+
type chaincodeIDSetter interface {
70+
SetChaincodeID(value string)
7171
}
7272

7373
func (p *params) PermitBlockEvents() {
@@ -93,9 +93,9 @@ func (p *params) SetSeekType(value seek.Type) {
9393
}
9494
}
9595

96-
func (p *params) SetChaincodeId(value string) {
96+
func (p *params) SetChaincodeID(value string) {
9797
logger.Debugf("ChaincodId: %d", value)
98-
p.chaincodeId = value
98+
p.chaincodeID = value
9999
}
100100

101101
func (p *params) SetResponseTimeout(value time.Duration) {

pkg/fabsdk/fabsdk_std.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
//go:build !pprof
12
// +build !pprof
23

34
/*

pkg/fabsdk/provider/chpvdr/cachekey.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ type params struct {
102102
permitBlockEvents bool
103103
seekType seek.Type
104104
fromBlock uint64
105-
chaincodeId string
105+
chaincodeID string
106106
}
107107

108108
func defaultParams() *params {
@@ -123,14 +123,14 @@ func (p *params) SetSeekType(value seek.Type) {
123123
}
124124
}
125125

126-
func (p *params) SetChaincodeId(value string) {
126+
func (p *params) SetChaincodeID(value string) {
127127
if value != "" {
128-
p.chaincodeId = value
128+
p.chaincodeID = value
129129
}
130130
}
131131

132132
func (p *params) getOptKey() string {
133133
// Construct opts portion
134-
optKey := fmt.Sprintf("blockEvents:%t,seekType:%s,fromBlock:%d,chaincodeId:%s", p.permitBlockEvents, p.seekType, p.fromBlock, p.chaincodeId)
134+
optKey := fmt.Sprintf("blockEvents:%t,seekType:%s,fromBlock:%d,chaincodeId:%s", p.permitBlockEvents, p.seekType, p.fromBlock, p.chaincodeID)
135135
return optKey
136136
}

0 commit comments

Comments
 (0)