.github/workflows: adding golangci-lint as new job (#453)

In order to follow golang's best practices, we should lint the code base properly beyond usual syntax mistakes.
This commit is contained in:
Stefan Benten
2021-12-26 14:03:27 +01:00
committed by GitHub
parent 5932a194b2
commit 2fbd19365c
9 changed files with 98 additions and 53 deletions

View File

@ -26,7 +26,6 @@ package server
import (
"fmt"
"io"
"net/http"
"github.com/gorilla/mux"
@ -49,9 +48,7 @@ func (s *Server) virusTotalHandler(w http.ResponseWriter, r *http.Request) {
http.Error(w, err.Error(), 500)
}
var reader io.Reader
reader = r.Body
reader := r.Body
result, err := vt.Scan(filename, reader)
if err != nil {
@ -59,5 +56,5 @@ func (s *Server) virusTotalHandler(w http.ResponseWriter, r *http.Request) {
}
s.logger.Println(result)
w.Write([]byte(fmt.Sprintf("%v\n", result.Permalink)))
_, _ = w.Write([]byte(fmt.Sprintf("%v\n", result.Permalink)))
}