Minor clean up

This commit is contained in:
Riccardo
2022-07-30 13:35:14 +02:00
parent 9f5d892e5b
commit 61b13de6ec
4 changed files with 11 additions and 6 deletions

View File

@@ -22,7 +22,8 @@ func Handler(ctx context.Context) (string, error) {
fetchSize, _ := strconv.Atoi(os.Getenv("FETCH_SIZE"))
var newsBatch []db.News
table := "news_table"
table := hackernews.HackernewsTable()
htmlTemplate := hackernews.HackernewsTable()
cfg, err := config.LoadDefaultConfig(context.TODO())
if err != nil {
@@ -64,7 +65,7 @@ func Handler(ctx context.Context) (string, error) {
todayNews, _ := db.ReadTodayNews(newsTable, int(timeStart.Unix()), int(timeEnd.Unix()))
t, err := template.ParseFiles("mail/index.gohtml")
t, err := template.ParseFiles(fmt.Sprintf("assets/%v.gohtml", htmlTemplate))
if err != nil {
log.Fatalln(err)
}