Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tag can be split into max 3 #886

Merged
merged 2 commits into from
Oct 11, 2016
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion service/dynamodb/dynamodbattribute/tag.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ func (t *tag) parseJSONTag(structTag reflect.StructTag) {
}

func (t *tag) parseTagStr(tagStr string) {
parts := strings.SplitN(tagStr, ",", 2)
parts := strings.SplitN(tagStr, ",", 3)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can just change this to Split instead of SplitN. I don't think we need to limit the number of parts in the tag.

if len(parts) == 0 {
return
}
Expand Down
1 change: 1 addition & 0 deletions service/dynamodb/dynamodbattribute/tag_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ func TestTagParse(t *testing.T) {
{`dynamodbav:",binaryset"`, false, true, tag{AsBinSet: true}},
{`dynamodbav:",numberset"`, false, true, tag{AsNumSet: true}},
{`dynamodbav:",stringset"`, false, true, tag{AsStrSet: true}},
{`dynamodbav:",stringset,omitemptyelem"`, false, true, tag{AsStrSet: true,OmitEmptyElem:true}},
}

for i, c := range cases {
Expand Down