From 40e820c416d00b4cea5c48bac1091476976d2cc8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Mierzwa?= Date: Sat, 11 Aug 2018 08:38:41 +0100 Subject: [PATCH] fix(style): remove dead code --- assets.go | 23 ----------------------- 1 file changed, 23 deletions(-) diff --git a/assets.go b/assets.go index bc48da1a5..0fb520134 100644 --- a/assets.go +++ b/assets.go @@ -1,14 +1,11 @@ package main import ( - "bytes" "errors" "html/template" "net/http" "strings" - "github.com/gin-gonic/gin" - assetfs "github.com/elazarl/go-bindata-assetfs" log "github.com/sirupsen/logrus" ) @@ -75,23 +72,3 @@ func loadTemplate(t *template.Template, path string) *template.Template { return t } - -func responseFromStaticFile(c *gin.Context, filepath string, contentType string) { - if !staticFileSystem.Exists("/", filepath) { - c.String(404, "Not found") - return - } - - file, err := staticFileSystem.Open(filepath) - if err != nil { - c.AbortWithError(500, err) - return - } - buf := bytes.NewBuffer(nil) - _, err = buf.ReadFrom(file) - if err != nil { - c.AbortWithError(500, err) - return - } - c.Data(200, contentType, buf.Bytes()) -}