Added golangci linting and improved what was required
This commit is contained in:
committed by
ncthompson
parent
206159cdea
commit
2456f45836
@@ -7,20 +7,10 @@ import (
|
||||
"net/http"
|
||||
)
|
||||
|
||||
type static struct {
|
||||
http.FileSystem
|
||||
}
|
||||
|
||||
func NewStatic() http.Handler {
|
||||
statikFs, err := fs.New()
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
return &static{
|
||||
FileSystem: statikFs,
|
||||
}
|
||||
}
|
||||
|
||||
func (s *static) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
||||
http.FileServer(s).ServeHTTP(w, r)
|
||||
return http.FileServer(statikFs)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user