Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.
 
 
 

14 linhas
297 B

  1. package handlers
  2. import (
  3. "net/http"
  4. )
  5. // StaticFileHandler, unlike net/http.FileServer, serves the contents of a specific
  6. // file when it is called.
  7. func StaticFileHandler(path string) http.HandlerFunc {
  8. return func(w http.ResponseWriter, r *http.Request) {
  9. http.ServeFile(w, r, path)
  10. }
  11. }