crowdmob/goamz — pull request #38 by jbert (2013-10-07 14:17:11+00:00)
Title: detect 'missing item' in GetItem and flag it as a specific error condition

The code currently returns a generic json parsing error ("unexpected response") if it gets back json of "{}", which corresponds to "item not found".

With this change, the caller can test for this case with code structured like:

item, err := t.GetItem(...)
if err == dynamodb.ErrNotFound {
// no item matches the key, that's ok, but note item will be nil
} else {
if err != nil {
// Some error occurred, inspect err.Error()
} else {
// Item will be non-nil, let's use it
}
}