diff --git a/cmd/backend/rss.go b/cmd/backend/rss.go index c33ad8d..c6bac3f 100644 --- a/cmd/backend/rss.go +++ b/cmd/backend/rss.go @@ -55,7 +55,7 @@ func GenerateRSS(c *Config, db *DB) (*string, error) { } item := &rss.Item{ - Author: fmt.Sprint(user.FirstName, " ", user.LastName), + Author: user.FirstName + " " + user.LastName, Categories: tagNames, Description: articleDescription, Guid: string(article.ID), diff --git a/cmd/calls/pdf.go b/cmd/calls/pdf.go index c0213eb..5de6a20 100644 --- a/cmd/calls/pdf.go +++ b/cmd/calls/pdf.go @@ -2,7 +2,6 @@ package calls import ( "encoding/json" - "fmt" "log" "net/http" "os" @@ -43,6 +42,6 @@ func ServePDF(c *b.Config) http.HandlerFunc { return } - http.ServeFile(w, r, fmt.Sprint(c.PDFDir, "/", r.PathValue("id"))) + http.ServeFile(w, r, c.PDFDir+"/"+r.PathValue("id")) } } diff --git a/cmd/frontend/articles.go b/cmd/frontend/articles.go index e7dcf5c..7ae74b4 100644 --- a/cmd/frontend/articles.go +++ b/cmd/frontend/articles.go @@ -547,7 +547,7 @@ func UploadArticleImage(c *b.Config, s *b.CookieStore) http.HandlerFunc { return } - url := fmt.Sprint(c.Domain, "/image/serve/", filename) + url := c.Domain + "/image/serve/" + filename w.Header().Set("Content-Type", "application/json") json.NewEncoder(w).Encode(url) } diff --git a/cmd/frontend/issues.go b/cmd/frontend/issues.go index f7ad2df..a870380 100644 --- a/cmd/frontend/issues.go +++ b/cmd/frontend/issues.go @@ -61,7 +61,7 @@ func PublishLatestIssue(c *b.Config, db *b.DB, s *b.CookieStore) http.HandlerFun article := &b.Article{ Title: title, - EncURL: fmt.Sprint(c.Domain, "/image/serve/", imgFileName), + EncURL: c.Domain + "/image/serve/" + imgFileName, EncLength: int(imgInfo.Size()), EncType: mime.TypeByExtension(filepath.Ext(imgAbsName)), Published: true, diff --git a/cmd/frontend/pdf.go b/cmd/frontend/pdf.go index 3e5e005..6a4e5e4 100644 --- a/cmd/frontend/pdf.go +++ b/cmd/frontend/pdf.go @@ -51,7 +51,7 @@ func UploadPDF(c *b.Config, s *b.CookieStore) http.HandlerFunc { } filename := fmt.Sprint(uuid.New(), ".pdf") - absFilepath, err := filepath.Abs(fmt.Sprint(c.PDFDir, "/", filename)) + absFilepath, err := filepath.Abs(c.PDFDir + "/" + filename) if err != nil { log.Println(err) http.Error(w, err.Error(), http.StatusInternalServerError)