.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:
@ -393,7 +393,7 @@ func (s *Server) Run() {
|
||||
go func() {
|
||||
s.logger.Println("Profiled listening at: :6060")
|
||||
|
||||
http.ListenAndServe(":6060", nil)
|
||||
_ = http.ListenAndServe(":6060", nil)
|
||||
}()
|
||||
}
|
||||
|
||||
@ -424,8 +424,14 @@ func (s *Server) Run() {
|
||||
s.logger.Panicf("Unable to parse: path=%s, err=%s", path, err)
|
||||
}
|
||||
|
||||
htmlTemplates.New(stripPrefix(path)).Parse(string(bytes))
|
||||
textTemplates.New(stripPrefix(path)).Parse(string(bytes))
|
||||
_, err = htmlTemplates.New(stripPrefix(path)).Parse(string(bytes))
|
||||
if err != nil {
|
||||
s.logger.Panicln("Unable to parse template")
|
||||
}
|
||||
_, err = textTemplates.New(stripPrefix(path)).Parse(string(bytes))
|
||||
if err != nil {
|
||||
s.logger.Panicln("Unable to parse template")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -493,7 +499,7 @@ func (s *Server) Run() {
|
||||
|
||||
r.NotFoundHandler = http.HandlerFunc(s.notFoundHandler)
|
||||
|
||||
mime.AddExtensionType(".md", "text/x-markdown")
|
||||
_ = mime.AddExtensionType(".md", "text/x-markdown")
|
||||
|
||||
s.logger.Printf("Transfer.sh server started.\nusing temp folder: %s\nusing storage provider: %s", s.tempPath, s.storage.Type())
|
||||
|
||||
@ -532,7 +538,7 @@ func (s *Server) Run() {
|
||||
s.logger.Printf("listening on port: %v\n", s.ListenerString)
|
||||
|
||||
go func() {
|
||||
srvr.ListenAndServe()
|
||||
_ = srvr.ListenAndServe()
|
||||
}()
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user