Skip to content

Commit 2806a31

Browse files
authored
[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()
1 parent 8a51c48 commit 2806a31

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

modules/public/public.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ package public
66

77
import (
88
"encoding/base64"
9+
"fmt"
910
"log"
1011
"net/http"
1112
"path"
@@ -159,7 +160,7 @@ func (opts *Options) handle(ctx *macaron.Context, log *log.Logger, opt *Options)
159160
// Add an Expires header to the static content
160161
if opt.ExpiresAfter > 0 {
161162
ctx.Resp.Header().Set("Expires", time.Now().Add(opt.ExpiresAfter).UTC().Format(http.TimeFormat))
162-
tag := GenerateETag(string(fi.Size()), fi.Name(), fi.ModTime().UTC().Format(http.TimeFormat))
163+
tag := GenerateETag(fmt.Sprint(fi.Size()), fi.Name(), fi.ModTime().UTC().Format(http.TimeFormat))
163164
ctx.Resp.Header().Set("ETag", tag)
164165
if ctx.Req.Header.Get("If-None-Match") == tag {
165166
ctx.Resp.WriteHeader(304)

0 commit comments

Comments
 (0)