Skip to content

Commit 6224776

Browse files
authored
Fixes Go Vet and fmt issues (#130)
1 parent 3809c48 commit 6224776

File tree

46 files changed

+5049
-5049
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+5049
-5049
lines changed

aws/request_pagination_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ func TestPagination(t *testing.T) {
5656
},
5757
}
5858

59-
retryer := aws.DefaultRetryer{2}
59+
retryer := aws.DefaultRetryer{NumMaxRetries: 2}
6060
op := aws.Operation{
6161
Name: "Operation",
6262
Paginator: &aws.Paginator{
@@ -158,7 +158,7 @@ func TestPaginationTruncation(t *testing.T) {
158158
}
159159

160160
reqNum := 0
161-
retryer := aws.DefaultRetryer{2}
161+
retryer := aws.DefaultRetryer{NumMaxRetries: 2}
162162
ops := []aws.Operation{
163163
{
164164
Name: "Operation",
@@ -269,7 +269,7 @@ func BenchmarkPagination(b *testing.B) {
269269
{aws.String("3"), aws.String("")},
270270
}
271271

272-
retryer := aws.DefaultRetryer{2}
272+
retryer := aws.DefaultRetryer{NumMaxRetries: 2}
273273
op := aws.Operation{
274274
Name: "Operation",
275275
Paginator: &aws.Paginator{

example/aws/credentials/plugincreds/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ import (
1010

1111
"github.com/aws/aws-sdk-go-v2/aws"
1212
"github.com/aws/aws-sdk-go-v2/aws/endpoints"
13-
"github.com/aws/aws-sdk-go-v2/aws/plugincreds"
1413
"github.com/aws/aws-sdk-go-v2/aws/external"
14+
"github.com/aws/aws-sdk-go-v2/aws/plugincreds"
1515
"github.com/aws/aws-sdk-go-v2/service/s3"
1616
"github.com/aws/aws-sdk-go-v2/service/s3/s3manager"
1717
)

example/aws/endpoints/customEndpoint/customEndpoint.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ package main
44

55
import (
66
"github.com/aws/aws-sdk-go-v2/aws"
7-
"github.com/aws/aws-sdk-go-v2/aws/external"
87
"github.com/aws/aws-sdk-go-v2/aws/endpoints"
8+
"github.com/aws/aws-sdk-go-v2/aws/external"
99
"github.com/aws/aws-sdk-go-v2/service/dynamodb"
1010
"github.com/aws/aws-sdk-go-v2/service/s3"
1111
"github.com/aws/aws-sdk-go-v2/service/sqs"

example/service/s3/presignURL/server/server.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ import (
1414
"time"
1515

1616
"github.com/aws/aws-sdk-go-v2/aws"
17-
"github.com/aws/aws-sdk-go-v2/aws/external"
1817
"github.com/aws/aws-sdk-go-v2/aws/endpoints"
18+
"github.com/aws/aws-sdk-go-v2/aws/external"
1919
"github.com/aws/aws-sdk-go-v2/service/s3"
2020
"github.com/aws/aws-sdk-go-v2/service/s3/s3iface"
2121
"github.com/aws/aws-sdk-go-v2/service/s3/s3manager"

private/model/api/passes_test.go

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -105,23 +105,23 @@ func TestCollidingFields(t *testing.T) {
105105
Shapes: []*Shapes{
106106
{
107107
MemberRefs: map[string]*ShapeRef{
108-
"String": &ShapeRef{},
109-
"GoString": &ShapeRef{},
110-
"Validate": &ShapeRef{},
111-
"Foo": &ShapeRef{},
112-
"SetFoo": &ShapeRef{},
108+
"String": {},
109+
"GoString": {},
110+
"Validate": {},
111+
"Foo": {},
112+
"SetFoo": {},
113113
},
114114
},
115115
},
116116
},
117117
[]*Shapes{
118118
{
119119
MemberRefs: map[string]*ShapeRef{
120-
"String_": &ShapeRef{},
121-
"GoString_": &ShapeRef{},
122-
"Validate_": &ShapeRef{},
123-
"Foo": &ShapeRef{},
124-
"SetFoo_": &ShapeRef{},
120+
"String_": {},
121+
"GoString_": {},
122+
"Validate_": {},
123+
"Foo": {},
124+
"SetFoo_": {},
125125
},
126126
},
127127
},

private/model/api/shape_marshal.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ var marshalShapeRefTmpl = template.Must(template.New("marshalShapeRefTmpl").Func
232232
{{- $helperName := $.EncodeHelperName "map" -}}
233233
{{ $helperName }}
234234
{{- else if $.Ref.Shape.IsEnum -}}
235-
{{ if $.Quoted }}protocol.QuotedValue{ {{ end }}v{{ if $.Quoted }} } {{ end }}
235+
{{ if $.Quoted }}protocol.QuotedValue{ValueMarshaler: {{ end }}v{{ if $.Quoted }} } {{ end }}
236236
{{- else if $.IsShapeType "structure" -}}
237237
v
238238
{{- else if $.IsShapeType "timestamp" -}}
@@ -248,7 +248,7 @@ var marshalShapeRefTmpl = template.Must(template.New("marshalShapeRefTmpl").Func
248248
{{- else if $.IsPayloadStream -}}
249249
protocol.{{ $.GoType }}{{ $.MarshalerType }}{V:v}
250250
{{- else -}}
251-
{{ if $.Quoted }}protocol.QuotedValue{ {{ end }}protocol.{{ $.GoType }}{{ $.MarshalerType }}(v){{ if $.Quoted }} } {{ end }}
251+
{{ if $.Quoted }}protocol.QuotedValue{ValueMarshaler: {{ end }}protocol.{{ $.GoType }}{{ $.MarshalerType }}(v){{ if $.Quoted }} } {{ end }}
252252
{{- end -}}
253253
{{- end }}
254254
@@ -413,7 +413,7 @@ func Collection(ref marshalShapeRef, level int) string {
413413
buf.WriteString(fmt.Sprintf("%s.ListAddValue(protocol.TimeValue{V: v%d})\n", parentVar, level))
414414
} else {
415415
if ref.Quoted() {
416-
buf.WriteString(fmt.Sprintf("%s.ListAddValue(protocol.QuotedValue{protocol.%s%s(v%d)})\n", parentVar, ref.GoType(), ref.MarshalerType(), level))
416+
buf.WriteString(fmt.Sprintf("%s.ListAddValue(protocol.QuotedValue{ValueMarshaler: protocol.%s%s(v%d)})\n", parentVar, ref.GoType(), ref.MarshalerType(), level))
417417
} else {
418418
buf.WriteString(fmt.Sprintf("%s.ListAddValue(protocol.%s%s(v%d))\n", parentVar, ref.GoType(), ref.MarshalerType(), level))
419419
}
@@ -427,7 +427,7 @@ func Collection(ref marshalShapeRef, level int) string {
427427
buf.WriteString(fmt.Sprintf("%s.MapSetValue(k%d, protocol.TimeValue{V: v%d})\n", parentVar, level, level))
428428
} else {
429429
if ref.Quoted() {
430-
buf.WriteString(fmt.Sprintf("%s.MapSetValue(k%d, protocol.QuotedValue{protocol.%s%s(v%d)})\n", parentVar, level, ref.GoType(), ref.MarshalerType(), level))
430+
buf.WriteString(fmt.Sprintf("%s.MapSetValue(k%d, protocol.QuotedValue{ValueMarshaler: protocol.%s%s(v%d)})\n", parentVar, level, ref.GoType(), ref.MarshalerType(), level))
431431
} else {
432432
buf.WriteString(fmt.Sprintf("%s.MapSetValue(k%d, protocol.%s%s(v%d))\n", parentVar, level, ref.GoType(), ref.MarshalerType(), level))
433433
}

private/protocol/json/encode_test.go

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ type payloadShape struct {
170170

171171
func (s *payloadShape) MarshalFields(e protocol.FieldEncoder) error {
172172
if s.Value != nil {
173-
e.SetValue(protocol.BodyTarget, "value", protocol.QuotedValue{protocol.StringValue(*s.Value)}, protocol.Metadata{})
173+
e.SetValue(protocol.BodyTarget, "value", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(*s.Value)}, protocol.Metadata{})
174174
}
175175
if s.IntVal != nil {
176176
e.SetValue(protocol.BodyTarget, "intval", protocol.Int64Value(*s.IntVal), protocol.Metadata{})
@@ -187,7 +187,7 @@ func (s *payloadShape) MarshalFields(e protocol.FieldEncoder) error {
187187
me := e.Map(protocol.BodyTarget, "mapstr", protocol.Metadata{})
188188
me.Start()
189189
for k, v := range s.MapStr {
190-
me.MapSetValue(k, protocol.QuotedValue{protocol.StringValue(*v)})
190+
me.MapSetValue(k, protocol.QuotedValue{ValueMarshaler: protocol.StringValue(*v)})
191191
}
192192
me.End()
193193
}
@@ -197,7 +197,7 @@ func (s *payloadShape) MarshalFields(e protocol.FieldEncoder) error {
197197
})
198198
me.Start()
199199
for k, v := range s.MapFlatten {
200-
me.MapSetValue(k, protocol.QuotedValue{protocol.StringValue(*v)})
200+
me.MapSetValue(k, protocol.QuotedValue{ValueMarshaler: protocol.StringValue(*v)})
201201
}
202202
me.End()
203203
}
@@ -207,7 +207,7 @@ func (s *payloadShape) MarshalFields(e protocol.FieldEncoder) error {
207207
})
208208
me.Start()
209209
for k, v := range s.MapNamed {
210-
me.MapSetValue(k, protocol.QuotedValue{protocol.StringValue(*v)})
210+
me.MapSetValue(k, protocol.QuotedValue{ValueMarshaler: protocol.StringValue(*v)})
211211
}
212212
me.End()
213213
}
@@ -243,7 +243,7 @@ func (s *payloadShape) MarshalFields(e protocol.FieldEncoder) error {
243243
le := e.List(protocol.BodyTarget, "liststr", protocol.Metadata{})
244244
le.Start()
245245
for _, v := range s.ListStr {
246-
le.ListAddValue(protocol.QuotedValue{protocol.StringValue(*v)})
246+
le.ListAddValue(protocol.QuotedValue{ValueMarshaler: protocol.StringValue(*v)})
247247
}
248248
le.End()
249249
}
@@ -253,7 +253,7 @@ func (s *payloadShape) MarshalFields(e protocol.FieldEncoder) error {
253253
})
254254
le.Start()
255255
for _, v := range s.ListFlatten {
256-
le.ListAddValue(protocol.QuotedValue{protocol.StringValue(*v)})
256+
le.ListAddValue(protocol.QuotedValue{ValueMarshaler: protocol.StringValue(*v)})
257257
}
258258
le.End()
259259
}
@@ -263,7 +263,7 @@ func (s *payloadShape) MarshalFields(e protocol.FieldEncoder) error {
263263
})
264264
le.Start()
265265
for _, v := range s.ListNamed {
266-
le.ListAddValue(protocol.QuotedValue{protocol.StringValue(*v)})
266+
le.ListAddValue(protocol.QuotedValue{ValueMarshaler: protocol.StringValue(*v)})
267267
}
268268
le.End()
269269
}
@@ -306,13 +306,13 @@ type nestedShape struct {
306306

307307
func (s *nestedShape) MarshalFields(e protocol.FieldEncoder) error {
308308
if s.Value != nil {
309-
e.SetValue(protocol.BodyTarget, "value", protocol.QuotedValue{protocol.StringValue(*s.Value)}, protocol.Metadata{})
309+
e.SetValue(protocol.BodyTarget, "value", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(*s.Value)}, protocol.Metadata{})
310310
}
311311
if s.IntVal != nil {
312312
e.SetValue(protocol.BodyTarget, "intval", protocol.Int64Value(*s.IntVal), protocol.Metadata{})
313313
}
314314
if s.Prefixed != nil {
315-
e.SetValue(protocol.BodyTarget, "prefixed", protocol.QuotedValue{protocol.StringValue(*s.Prefixed)}, protocol.Metadata{})
315+
e.SetValue(protocol.BodyTarget, "prefixed", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(*s.Prefixed)}, protocol.Metadata{})
316316
}
317317
return nil
318318
}

private/protocol/rest/encode_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ func TestSetQueryMapList(t *testing.T) {
279279
if e, a := 2, len(query); e != a {
280280
t.Errorf("expect %d query values, got %d", e, a)
281281
}
282-
for k, vs := range map[string][]string{"a": []string{"a1", "a2"}, "b": []string{"b1", "b2"}} {
282+
for k, vs := range map[string][]string{"a": {"a1", "a2"}, "b": {"b1", "b2"}} {
283283
as, ok := query[k]
284284
if !ok {
285285
t.Fatalf("expect %s to exist, was not", k)

0 commit comments

Comments
 (0)