From f04fb5cf14385581c2c0d0efd204d2afd2139221 Mon Sep 17 00:00:00 2001 From: Alex Scerba Date: Tue, 11 Feb 2025 15:05:15 -0500 Subject: Remove redundant data type --- cmd/http/load.go | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'cmd/http/load.go') diff --git a/cmd/http/load.go b/cmd/http/load.go index 6ab2eba..6e0c031 100644 --- a/cmd/http/load.go +++ b/cmd/http/load.go @@ -15,13 +15,8 @@ type Post struct { Tags []string } -// Posts stuct contains a collection of type Post -type Posts struct { - Collection []*Post -} - // Read all found files and load them into a stuct -func (app *application) aggregate(location string) (p *Posts, err error) { +func (app *application) aggregate(location string) (p []*Post, err error) { var posts []*Post files, err := os.ReadDir(location) @@ -42,7 +37,7 @@ func (app *application) aggregate(location string) (p *Posts, err error) { return posts[i].Date > posts[j].Date }) - return &Posts{Collection: posts}, nil + return posts, nil } func (app *application) parseFileName(file string) (p *Post) { -- cgit v1.2.3