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

Improve comments and add a doc.go #1515

Merged
merged 5 commits into from
Sep 13, 2017
Merged

Conversation

hhayano
Copy link

@hhayano hhayano commented Sep 11, 2017

For changes to files under the /model/ folder, and manual edits to autogenerated code (e.g. /service/s3/api.go) please create an Issue instead of a PR for those type of changes.

If there is an existing bug or feature this PR is answers please reference it here.

@jasdel jasdel requested review from xibz and jasdel and removed request for xibz September 12, 2017 16:54
@jasdel jasdel self-assigned this Sep 12, 2017
Copy link
Contributor

@jasdel jasdel left a comment

Choose a reason for hiding this comment

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

Looks good, really great to have the extra docs and examples.

In general I suggest taking an additional pass over some of the wording. In several cases a Users is referenced. In this case since the reader is the audience I'd suggest using you, or reword to be declarative without referencing the audience directly.

Also a couple cases of future tense vs precent mentioned below.

// This example scans the entire Music table, and then narrows the results to songs
// by the artist "No One You Know". For each item, only the album title and song title
// are returned.
func ExampleBuilder_WithFilter_shared00() {
Copy link
Contributor

Choose a reason for hiding this comment

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

The _shared00 part isn't needed for these docs.

accordingly. For example, ConditionBuilder represents a DynamoDB Condition
Expression, an UpdateBuilder represents a DynamoDB Update Expression, and so
forth.
The following example will show a sample ConditionExpression and how to build an
Copy link
Contributor

Choose a reason for hiding this comment

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

future tense :)

`The following is an example using a condition builder to create the expression where DynamoDB record's field name "Artist" equals the value "No One You Know".

condExpr := "Artist = :a"
condBuilder := expression.Name("Artist").Equal(expression.Value("No One You Know"))

In order to retrieve the formatted DynamoDB Expression strings, users must call
Copy link
Contributor

Choose a reason for hiding this comment

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

nit, audience is the reader, not a third party the reader will instruct on how to use the library.

In this case can replace users must call, with just call the.

// WithFilter method adds the argument ConditionBuilder as a Filter Expression
// to the argument Builder. If the argument Builder already has a
// ConditionBuilder representing a Filter Expression, WithFilter()
// overwrites the existing ConditionBuilder. Users are able to add other
Copy link
Contributor

Choose a reason for hiding this comment

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

target you, instead of Users. Or consider reword to more declarative such as, Additional expressions can be added to the Builder via the With___ methods. To build an Expression, call Build.

Copy link
Contributor

@jasdel jasdel left a comment

Choose a reason for hiding this comment

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

Looks good just a couple comments. Namely with the readme.md file.

TableName: aws.String("Music"),
}

Users must always fill in the ExpressionAttributeNames and
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit Users :)

}


#### Idiosyncrasies of the Expression Package
Copy link
Contributor

Choose a reason for hiding this comment

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

Not really sure this section adds very much value to the user to the documentation.

To explain expression specific requirements/expectations would be better in the Builder types themselves.

@@ -0,0 +1,94 @@
# expression
Copy link
Contributor

Choose a reason for hiding this comment

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

This file's content should be apart of the doc.go file . This file as it is will never be visible to users when using godoc, or similar tools.

A new file added to the https://github.com/awsdocs/aws-go-developer-guide repo would be a good place to put extra higher level documentation, concepts, and detailed example based information. But About DynamoDB Expressions and Using the Package sections should be in the doc.go file regardless.

Copy link
Contributor

@jasdel jasdel left a comment

Choose a reason for hiding this comment

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

looks good :)

@jasdel jasdel merged commit 3ad0142 into aws:dynamodb-abstraction Sep 13, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants