Skip to content

Commit e14f208

Browse files
[FAB-7802] Automatic format fix using gofmt
gofmt -w -s Many developers have integrated `gofmt` auto-formatting. S Some code changes can automatically cause other changes caused through `gofmt` integration, not related to the intent of the task. For clarity in future pull-requests, the gofmt issues should be solved once and for all. This change doesn't break the code, because it uses official `gofmt` to do the auto code formatting. Change-Id: Ife1c2e112dc4f188fb6a90916587af453a133099 Signed-off-by: Robert Zaremba <robert.zaremba@scale-it.pl>
1 parent 2c8a82a commit e14f208

File tree

25 files changed

+68
-68
lines changed

25 files changed

+68
-68
lines changed

common/capabilities/application_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ func TestApplicationV10(t *testing.T) {
2121

2222
func TestApplicationV11(t *testing.T) {
2323
op := NewApplicationProvider(map[string]*cb.Capability{
24-
ApplicationV1_1: &cb.Capability{},
24+
ApplicationV1_1: {},
2525
})
2626
assert.NoError(t, op.Supported())
2727
assert.True(t, op.ForbidDuplicateTXIdInBlock())

common/capabilities/capabilities_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ func TestSatisfied(t *testing.T) {
3232

3333
func TestNotSatisfied(t *testing.T) {
3434
capsMap := map[string]*cb.Capability{
35-
"FakeCapability": &cb.Capability{},
35+
"FakeCapability": {},
3636
}
3737
for _, provider := range []*registry{
3838
NewChannelProvider(capsMap).registry,

common/capabilities/channel_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ func TestChannelV10(t *testing.T) {
2323

2424
func TestChannelV11(t *testing.T) {
2525
op := NewChannelProvider(map[string]*cb.Capability{
26-
ChannelV1_1: &cb.Capability{},
26+
ChannelV1_1: {},
2727
})
2828
assert.NoError(t, op.Supported())
2929
assert.True(t, op.MSPVersion() == msp.MSPv1_1)

common/capabilities/orderer_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ func TestOrdererV10(t *testing.T) {
2222

2323
func TestOrdererV11(t *testing.T) {
2424
op := NewOrdererProvider(map[string]*cb.Capability{
25-
OrdererV1_1: &cb.Capability{},
25+
OrdererV1_1: {},
2626
})
2727
assert.NoError(t, op.Supported())
2828
assert.True(t, op.SetChannelModPolicyDuringCreate())

common/channelconfig/bundle_test.go

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -221,10 +221,10 @@ func TestPrevalidation(t *testing.T) {
221221
err := preValidate(&cb.Config{
222222
ChannelGroup: &cb.ConfigGroup{
223223
Groups: map[string]*cb.ConfigGroup{
224-
OrdererGroupKey: &cb.ConfigGroup{},
224+
OrdererGroupKey: {},
225225
},
226226
Values: map[string]*cb.ConfigValue{
227-
CapabilitiesKey: &cb.ConfigValue{},
227+
CapabilitiesKey: {},
228228
},
229229
},
230230
})
@@ -237,12 +237,12 @@ func TestPrevalidation(t *testing.T) {
237237
err := preValidate(&cb.Config{
238238
ChannelGroup: &cb.ConfigGroup{
239239
Groups: map[string]*cb.ConfigGroup{
240-
ApplicationGroupKey: &cb.ConfigGroup{
240+
ApplicationGroupKey: {
241241
Values: map[string]*cb.ConfigValue{
242-
CapabilitiesKey: &cb.ConfigValue{},
242+
CapabilitiesKey: {},
243243
},
244244
},
245-
OrdererGroupKey: &cb.ConfigGroup{},
245+
OrdererGroupKey: {},
246246
},
247247
},
248248
})
@@ -255,19 +255,19 @@ func TestPrevalidation(t *testing.T) {
255255
err := preValidate(&cb.Config{
256256
ChannelGroup: &cb.ConfigGroup{
257257
Groups: map[string]*cb.ConfigGroup{
258-
ApplicationGroupKey: &cb.ConfigGroup{
258+
ApplicationGroupKey: {
259259
Values: map[string]*cb.ConfigValue{
260-
CapabilitiesKey: &cb.ConfigValue{},
260+
CapabilitiesKey: {},
261261
},
262262
},
263-
OrdererGroupKey: &cb.ConfigGroup{
263+
OrdererGroupKey: {
264264
Values: map[string]*cb.ConfigValue{
265-
CapabilitiesKey: &cb.ConfigValue{},
265+
CapabilitiesKey: {},
266266
},
267267
},
268268
},
269269
Values: map[string]*cb.ConfigValue{
270-
CapabilitiesKey: &cb.ConfigValue{},
270+
CapabilitiesKey: {},
271271
},
272272
},
273273
})

common/channelconfig/util_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,6 @@ func TestUtilsBasic(t *testing.T) {
4040
basicTest(t, KafkaBrokersValue([]string{"foo:1", "bar:2"}))
4141
basicTest(t, MSPValue(&mspprotos.MSPConfig{}))
4242
basicTest(t, CapabilitiesValue(map[string]bool{"foo": true, "bar": false}))
43-
basicTest(t, AnchorPeersValue([]*pb.AnchorPeer{&pb.AnchorPeer{}, &pb.AnchorPeer{}}))
43+
basicTest(t, AnchorPeersValue([]*pb.AnchorPeer{{}, {}}))
4444
basicTest(t, ChannelCreationPolicyValue(&cb.Policy{}))
4545
}

common/configtx/update_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ func TestPolicyForItem(t *testing.T) {
128128
pm: &mockpolicies.Manager{
129129
Policy: rootPolicy,
130130
SubManagersMap: map[string]*mockpolicies.Manager{
131-
"foo": &mockpolicies.Manager{
131+
"foo": {
132132
Policy: fooPolicy,
133133
},
134134
},

common/resourcesconfig/apis_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,12 @@ const (
2626

2727
var sampleAPIsGroup = &cb.ConfigGroup{
2828
Values: map[string]*cb.ConfigValue{
29-
sampleAPI1Name: &cb.ConfigValue{
29+
sampleAPI1Name: {
3030
Value: utils.MarshalOrPanic(&pb.APIResource{
3131
PolicyRef: sampleAPI1PolicyRef,
3232
}),
3333
},
34-
sampleAPI2Name: &cb.ConfigValue{
34+
sampleAPI2Name: {
3535
Value: utils.MarshalOrPanic(&pb.APIResource{
3636
PolicyRef: sampleAPI2PolicyRef,
3737
}),
@@ -57,7 +57,7 @@ func TestGreenAPIsPath(t *testing.T) {
5757
func TestBadSubgroupsAPIsGroup(t *testing.T) {
5858
ccg, err := newAPIsGroup(&cb.ConfigGroup{
5959
Groups: map[string]*cb.ConfigGroup{
60-
"subGroup": &cb.ConfigGroup{},
60+
"subGroup": {},
6161
},
6262
})
6363

common/resourcesconfig/bundle_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ func TestBundleFailure(t *testing.T) {
5151
Config: &cb.Config{
5252
ChannelGroup: &cb.ConfigGroup{
5353
Groups: map[string]*cb.ConfigGroup{
54-
"badsubgroup": &cb.ConfigGroup{},
54+
"badsubgroup": {},
5555
},
5656
},
5757
},

common/resourcesconfig/chaincode_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,19 +29,19 @@ var (
2929

3030
var sampleChaincodeGroup = &cb.ConfigGroup{
3131
Values: map[string]*cb.ConfigValue{
32-
"ChaincodeIdentifier": &cb.ConfigValue{
32+
"ChaincodeIdentifier": {
3333
Value: utils.MarshalOrPanic(&pb.ChaincodeIdentifier{
3434
Version: sampleChaincodeVersion,
3535
Hash: sampleChaincodeHash,
3636
}),
3737
},
38-
"ChaincodeValidation": &cb.ConfigValue{
38+
"ChaincodeValidation": {
3939
Value: utils.MarshalOrPanic(&pb.ChaincodeValidation{
4040
Name: sampleChaincodeValidationName,
4141
Argument: sampleChaincodeValidationArg,
4242
}),
4343
},
44-
"ChaincodeEndorsement": &cb.ConfigValue{
44+
"ChaincodeEndorsement": {
4545
Value: utils.MarshalOrPanic(&pb.ChaincodeEndorsement{
4646
Name: sampleChaincodeEndorsementName,
4747
}),
@@ -68,7 +68,7 @@ func TestGreenChaincodePath(t *testing.T) {
6868
func TestBadSubgroupsChaincodeGroup(t *testing.T) {
6969
ccg, err := newChaincodeGroup("bar", &cb.ConfigGroup{
7070
Groups: map[string]*cb.ConfigGroup{
71-
"subGroup": &cb.ConfigGroup{},
71+
"subGroup": {},
7272
},
7373
})
7474

0 commit comments

Comments
 (0)