From 93d37002ddf2793bf5c3a802f1803375c80f7ce7 Mon Sep 17 00:00:00 2001 From: mutantmonkey Date: Thu, 7 Jul 2016 19:34:53 -0700 Subject: [PATCH] remove unnecessary file processing in display.go There is no need to open the file here; nothing is done with the header after it is read. --- display.go | 6 ------ 1 file changed, 6 deletions(-) diff --git a/display.go b/display.go index f26b665..b196477 100644 --- a/display.go +++ b/display.go @@ -39,12 +39,6 @@ func fileDisplayHandler(c web.C, w http.ResponseWriter, r *http.Request) { extra := make(map[string]string) lines := []string{} - file, _ := fileBackend.Open(fileName) - defer file.Close() - - header := make([]byte, 512) - file.Read(header) - extension := strings.TrimPrefix(filepath.Ext(fileName), ".") if strings.EqualFold("application/json", r.Header.Get("Accept")) {