.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

@ -31,7 +31,6 @@ import (
// _ "transfer.sh/app/utils"
"fmt"
"io"
"net/http"
"time"
@ -50,9 +49,7 @@ func (s *Server) scanHandler(w http.ResponseWriter, r *http.Request) {
s.logger.Printf("Scanning %s %d %s", filename, contentLength, contentType)
var reader io.Reader
reader = r.Body
reader := r.Body
c := clamd.NewClamd(s.ClamAVDaemonHost)
@ -67,7 +64,7 @@ func (s *Server) scanHandler(w http.ResponseWriter, r *http.Request) {
select {
case s := <-response:
w.Write([]byte(fmt.Sprintf("%v\n", s.Status)))
_, _ = w.Write([]byte(fmt.Sprintf("%v\n", s.Status)))
case <-time.After(time.Second * 60):
abort <- true
}