style: fix linting issues

License: MIT
Signed-off-by: Henrique Dias <hacdias@gmail.com>
This commit is contained in:
Henrique Dias committed 2018-08-07 13:34:06 +01:00
1 parent 5afe2cc52d
commit b7022bdfe3
3 files changed
+6 -10

No files matched your search

+1 -2
View File
@@ -79,11 +79,10 @@ func downloadHandler(c *fb.Context, w http.ResponseWriter, r *http.Request) (int
func downloadFileHandler(c *fb.Context, w http.ResponseWriter, r *http.Request) (int, error) { func downloadFileHandler(c *fb.Context, w http.ResponseWriter, r *http.Request) (int, error) {
file, err := os.Open(c.File.Path) file, err := os.Open(c.File.Path)
defer file.Close()
if err != nil { if err != nil {
return http.StatusInternalServerError, err return http.StatusInternalServerError, err
} }
defer file.Close()
stat, err := file.Stat() stat, err := file.Stat()
if err != nil { if err != nil {
+3 -3
View File
@@ -2,12 +2,13 @@ package http
import ( import (
"bytes" "bytes"
fb "github.com/filebrowser/filebrowser"
"io/ioutil" "io/ioutil"
"net/http" "net/http"
"os" "os"
"path/filepath" "path/filepath"
"regexp" "regexp"
fb "github.com/filebrowser/filebrowser"
) )
func subtitlesHandler(c *fb.Context, w http.ResponseWriter, r *http.Request) (int, error) { func subtitlesHandler(c *fb.Context, w http.ResponseWriter, r *http.Request) (int, error) {
@@ -36,11 +37,10 @@ func subtitleHandler(c *fb.Context, w http.ResponseWriter, r *http.Request) (int
} }
file, err := os.Open(c.File.Path) file, err := os.Open(c.File.Path)
defer file.Close()
if err != nil { if err != nil {
return http.StatusInternalServerError, err return http.StatusInternalServerError, err
} }
defer file.Close()
stat, err := file.Stat() stat, err := file.Stat()
if err != nil { if err != nil {
+2 -5
View File
@@ -187,9 +187,6 @@ func (h Hugo) undraft(file string) error {
// Setup sets up the plugin. // Setup sets up the plugin.
func (h *Hugo) Setup() error { func (h *Hugo) Setup() error {
var err error var err error
if h.Exe, err = exec.LookPath("hugo"); err != nil { h.Exe, err = exec.LookPath("hugo")
return err return err
}
return nil
} }