From eee53cf49255a56eed8b13a439b13fcbd1715a4f Mon Sep 17 00:00:00 2001 From: serr Date: Tue, 15 Apr 2025 19:09:41 +0300 Subject: [PATCH] delete some code --- mvc/models/models_pages/posts.go | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/mvc/models/models_pages/posts.go b/mvc/models/models_pages/posts.go index 0d71d38..e47e7c1 100644 --- a/mvc/models/models_pages/posts.go +++ b/mvc/models/models_pages/posts.go @@ -4,7 +4,6 @@ import ( "bytes" "fmt" "html/template" - "io" "main/tools" "os" "path/filepath" @@ -30,13 +29,7 @@ func LoadPosts(dir string) (Posts, error) { } if !f.IsDir() && strings.HasSuffix(f.Name(), ".md") { - file, err := os.Open(path) - if err != nil { - return err - } - defer file.Close() - - md, err := io.ReadAll(file) + md, err := os.ReadFile(path) if err != nil { return err }