-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Commit
The basic key/value example has been updated to reflect the current client and proto APIs. The prepared batch example has also been updated to query the correct number of rows. Both examples were tested against a local cluster.
- Loading branch information
There are no files selected for viewing
5 comments
on commit ff0c6ed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this is actual functional code now, let's move it into client/client_test.go using the "Example" test pattern: http://golang.org/pkg/testing/#hdr-Examples
Let's change the actual examples in the document to be very concise, mostly non-functional bits, as you'd find in the description for the RPC package: http://golang.org/pkg/net/rpc/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe don't go too crazy with the different examples. Just two would suffice. Do an ExampleCall and an ExamplePrepareFlush to contain the two examples you currently have in doc.go. Just create the test server from scratch in each Example so you don't worry about what order they're run in (although I think there is a guarantee that they're run in order in which they appear in the code (although output compares separately for each example).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, probably do want one for transactions. Forgot about that...
We aren't doing any checking here if the key is not found. Not sure if that should be added to this example.