Added code for AWS Lambda

This commit is contained in:
Riccardo
2022-07-16 16:37:07 +02:00
parent a922a905c0
commit 98273e164d
6 changed files with 74 additions and 102 deletions

View File

@@ -15,7 +15,6 @@ import (
type Table struct {
DynamoDbClient *dynamodb.Client
TableName string
IndexName string
}
type News struct {
@@ -139,7 +138,9 @@ func ReadTodayNews(basics Table, timeStart int, timeEnd int) ([]News, error) {
}
}
fmt.Println("MARSH", len(response.Items), news[0])
if len(response.Items) > 0 {
fmt.Println("MARSH", len(response.Items), news[0])
}
return news, err
}