Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.
 
 
 

14 wiersze
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. }