New upstream version 1.2.0

This commit is contained in:
Sébastien Delafond
2018-01-03 12:07:20 +01:00
parent 3cbca50cad
commit f6225c4983
1486 changed files with 382952 additions and 136232 deletions
@@ -6,6 +6,7 @@ methods connecting to DynamoDB, or as `unitTest` demonstrates, create your own
## Test-compatible DynamoDB field
If you use `*dynamodb.DynamoDB` as a field, you will be unable to unit test it,
as documented in #88. Cast it instead as `dynamodbiface.DynamoDBAPI`:
```go
type ItemGetter struct {
DynamoDB dynamodbiface.DynamoDBAPI
@@ -14,6 +15,7 @@ type ItemGetter struct {
## Querying actual DynamoDB
You'll need an `*aws.Config` and `*session.Session` for these to work correctly:
```go
// Setup
var getter = new(ItemGetter)
@@ -30,6 +32,7 @@ Construct a `fakeDynamoDB` and add the necessary methods for each of those
structs (custom ones for `ItemGetter` and [whatever methods you're using for
DynamoDB](https://github.com/aws/aws-sdk-go/blob/master/service/dynamodb/dynamodbiface/interface.go)),
and you're good to go!
```go
type fakeDynamoDB struct {
dynamodbiface.DynamoDBAPI
@@ -42,7 +45,7 @@ getter.DynamoDB.GetItem(/* ... */)
## Output
```
$ go test -cover
$ go test -tags example -cover
PASS
coverage: 100.0% of statements
ok _/Users/shatil/workspace/aws-sdk-go/example/service/dynamodb/unitTest 0.008s