MCPcopy Create free account
hub / github.com/awsdocs/aws-doc-sdk-examples / GetItems

Function GetItems

go/dynamodb/LoadTableItems/LoadTableItems.go:31–44  ·  view source on GitHub ↗

snippet-end:[dynamodb.go.add_items.struct] GetItems creates a list of table items from a JSON file

(filename *string)

Source from the content-addressed store, hash-verified

29
30// GetItems creates a list of table items from a JSON file
31func GetItems(filename *string) ([]Item, error) {
32 raw, err := ioutil.ReadFile(*filename)
33 if err != nil {
34 return nil, err
35 }
36
37 var items []Item
38 err = json.Unmarshal(raw, &items)
39 if err != nil {
40 return nil, err
41 }
42
43 return items, nil
44}
45
46// GetMovieName gets the name of the movie from an attribute value
47func GetMovieName(av map[string]*dynamodb.AttributeValue) (string, error) {

Callers 2

TestCreateTableFunction · 0.70
mainFunction · 0.70

Calls

no outgoing calls

Tested by 1

TestCreateTableFunction · 0.56