fix(style): remove dead code

This commit is contained in:
Łukasz Mierzwa
2018-08-11 08:38:41 +01:00
parent cb7a6e71c0
commit 40e820c416

View File

@@ -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())
}