Merge pull request #93 from mutantmonkey/reduce_open_calls

Remove unnecessary file processing in display.go
This commit is contained in:
Andrei Marcu 2016-07-07 20:06:49 -07:00 committed by GitHub
commit ca11d99678
1 changed files with 0 additions and 6 deletions

View File

@ -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")) {