Skip to content

Commit ff8a377

Browse files
mlafeldtguregu
authored andcommitted
Simplify code using gofmt
gofmt -w -s *.go internal/exprs/*.go
1 parent a25f0e1 commit ff8a377

12 files changed

+118
-118
lines changed

createtable.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ func (ct *CreateTable) Project(index string, projection IndexProjection, include
152152
func (ct *CreateTable) Index(index Index) *CreateTable {
153153
ct.add(index.HashKey, string(index.HashKeyType))
154154
ks := []*dynamodb.KeySchemaElement{
155-
&dynamodb.KeySchemaElement{
155+
{
156156
AttributeName: &index.HashKey,
157157
KeyType: aws.String(dynamodb.KeyTypeHash),
158158
},

createtable_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ func TestCreateTable(t *testing.T) {
107107
WriteCapacityUnits: aws.Int64(2),
108108
},
109109
Tags: []*dynamodb.Tag{
110-
&dynamodb.Tag{
110+
{
111111
Key: aws.String("Tag-Key"),
112112
Value: aws.String("Tag-Value"),
113113
},

decode_test.go

+14-14
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ var itemDecodeOnlyTests = []struct {
1717
// unexported embedded pointers should be ignored
1818
name: "embedded unexported pointer",
1919
given: map[string]*dynamodb.AttributeValue{
20-
"Embedded": &dynamodb.AttributeValue{BOOL: aws.Bool(true)},
20+
"Embedded": {BOOL: aws.Bool(true)},
2121
},
2222
expect: struct {
2323
*embedded
@@ -27,7 +27,7 @@ var itemDecodeOnlyTests = []struct {
2727
// unexported fields should be ignored
2828
name: "unexported fields",
2929
given: map[string]*dynamodb.AttributeValue{
30-
"a": &dynamodb.AttributeValue{BOOL: aws.Bool(true)},
30+
"a": {BOOL: aws.Bool(true)},
3131
},
3232
expect: struct {
3333
a bool
@@ -37,7 +37,7 @@ var itemDecodeOnlyTests = []struct {
3737
// embedded pointers shouldn't clobber existing fields
3838
name: "exported pointer embedded struct clobber",
3939
given: map[string]*dynamodb.AttributeValue{
40-
"Embedded": &dynamodb.AttributeValue{S: aws.String("OK")},
40+
"Embedded": {S: aws.String("OK")},
4141
},
4242
expect: struct {
4343
Embedded string
@@ -76,10 +76,10 @@ func TestUnmarshalAppend(t *testing.T) {
7676
limit := "20"
7777
null := true
7878
item := map[string]*dynamodb.AttributeValue{
79-
"UserID": &dynamodb.AttributeValue{N: &id},
80-
"Page": &dynamodb.AttributeValue{N: &page},
81-
"Limit": &dynamodb.AttributeValue{N: &limit},
82-
"Null": &dynamodb.AttributeValue{NULL: &null},
79+
"UserID": {N: &id},
80+
"Page": {N: &page},
81+
"Limit": {N: &limit},
82+
"Null": {NULL: &null},
8383
}
8484

8585
for range [15]struct{}{} {
@@ -144,13 +144,13 @@ func TestUnmarshalNULL(t *testing.T) {
144144
arbitrary := "hello world"
145145
double := new(*int)
146146
item := map[string]*dynamodb.AttributeValue{
147-
"String": &dynamodb.AttributeValue{NULL: &tru},
148-
"Slice": &dynamodb.AttributeValue{NULL: &tru},
149-
"Array": &dynamodb.AttributeValue{NULL: &tru},
150-
"StringPtr": &dynamodb.AttributeValue{NULL: &tru},
151-
"DoublePtr": &dynamodb.AttributeValue{NULL: &tru},
152-
"Map": &dynamodb.AttributeValue{NULL: &tru},
153-
"Interface": &dynamodb.AttributeValue{NULL: &tru},
147+
"String": {NULL: &tru},
148+
"Slice": {NULL: &tru},
149+
"Array": {NULL: &tru},
150+
"StringPtr": {NULL: &tru},
151+
"DoublePtr": {NULL: &tru},
152+
"Map": {NULL: &tru},
153+
"Interface": {NULL: &tru},
154154
}
155155

156156
type resultType struct {

encode_test.go

+5-5
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ var itemEncodeOnlyTests = []struct {
2727
Other: true,
2828
},
2929
out: map[string]*dynamodb.AttributeValue{
30-
"L": &dynamodb.AttributeValue{L: []*dynamodb.AttributeValue{}},
31-
"M": &dynamodb.AttributeValue{M: map[string]*dynamodb.AttributeValue{}},
32-
"Other": &dynamodb.AttributeValue{BOOL: aws.Bool(true)},
30+
"L": {L: []*dynamodb.AttributeValue{}},
31+
"M": {M: map[string]*dynamodb.AttributeValue{}},
32+
"Other": {BOOL: aws.Bool(true)},
3333
},
3434
},
3535
{
@@ -44,7 +44,7 @@ var itemEncodeOnlyTests = []struct {
4444
Other: true,
4545
},
4646
out: map[string]*dynamodb.AttributeValue{
47-
"Other": &dynamodb.AttributeValue{BOOL: aws.Bool(true)},
47+
"Other": {BOOL: aws.Bool(true)},
4848
},
4949
},
5050
{
@@ -59,7 +59,7 @@ var itemEncodeOnlyTests = []struct {
5959
private2: new(int),
6060
},
6161
out: map[string]*dynamodb.AttributeValue{
62-
"Public": &dynamodb.AttributeValue{N: aws.String("555")},
62+
"Public": {N: aws.String("555")},
6363
},
6464
},
6565
}

encoding_aws_test.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -133,8 +133,8 @@ func TestAWSUnmarshalAppend(t *testing.T) {
133133
B: 222,
134134
}
135135
err := unmarshalAppend(map[string]*dynamodb.AttributeValue{
136-
"one": &dynamodb.AttributeValue{S: aws.String("test")},
137-
"two": &dynamodb.AttributeValue{N: aws.String("555")},
136+
"one": {S: aws.String("test")},
137+
"two": {N: aws.String("555")},
138138
}, AWSEncoding(&list))
139139
if err != nil {
140140
t.Error(err)
@@ -143,8 +143,8 @@ func TestAWSUnmarshalAppend(t *testing.T) {
143143
t.Error("bad AWS unmarshal append:", list)
144144
}
145145
err = unmarshalAppend(map[string]*dynamodb.AttributeValue{
146-
"one": &dynamodb.AttributeValue{S: aws.String("two")},
147-
"two": &dynamodb.AttributeValue{N: aws.String("222")},
146+
"one": {S: aws.String("two")},
147+
"two": {N: aws.String("222")},
148148
}, AWSEncoding(&list))
149149
if err != nil {
150150
t.Error(err)

0 commit comments

Comments
 (0)