Skip to content

Commit 40986ba

Browse files
committed
add scalar slice
1 parent 91784cc commit 40986ba

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

util_test.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ type Person struct {
1414
Human
1515
Name string `json:"name"`
1616
Home Address `json:"home"`
17+
Hobbies []string `json:"hobbies"`
1718
Friends []Friend `json:"friends"`
1819
}
1920

@@ -45,6 +46,7 @@ var personSource = Person{
4546
City: "Jakarta",
4647
},
4748
Friends: friendSource,
49+
Hobbies:[]string{"eat","sleep","code"},
4850
}
4951

5052
var friendSource = []Friend{
@@ -83,7 +85,8 @@ func TestBindFields(t *testing.T) {
8385
friends{name,address},
8486
age,
8587
weight,
86-
alive
88+
alive,
89+
hobbies
8790
}
8891
}
8992
`

0 commit comments

Comments
 (0)