From 2806a312e1902ed68de890c04a138a0ed038a765 Mon Sep 17 00:00:00 2001 From: 6543 <6543@obermui.de> Date: Fri, 4 Sep 2020 07:28:08 +0200 Subject: [PATCH] [Backport] Fix go1.15 lint error in modules/public/public.go (#12707) (#12708) * fix go1.15 lint error in modules/public/public.go * CI.restart() --- modules/public/public.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/public/public.go b/modules/public/public.go index 8d027855c2ee..790f418a20de 100644 --- a/modules/public/public.go +++ b/modules/public/public.go @@ -6,6 +6,7 @@ package public import ( "encoding/base64" + "fmt" "log" "net/http" "path" @@ -159,7 +160,7 @@ func (opts *Options) handle(ctx *macaron.Context, log *log.Logger, opt *Options) // Add an Expires header to the static content if opt.ExpiresAfter > 0 { ctx.Resp.Header().Set("Expires", time.Now().Add(opt.ExpiresAfter).UTC().Format(http.TimeFormat)) - tag := GenerateETag(string(fi.Size()), fi.Name(), fi.ModTime().UTC().Format(http.TimeFormat)) + tag := GenerateETag(fmt.Sprint(fi.Size()), fi.Name(), fi.ModTime().UTC().Format(http.TimeFormat)) ctx.Resp.Header().Set("ETag", tag) if ctx.Req.Header.Get("If-None-Match") == tag { ctx.Resp.WriteHeader(304)