file.go 199 B

12345678910111213
  1. package render
  2. import "net/http"
  3. type File struct {
  4. Path string
  5. Request *http.Request
  6. }
  7. func (r File) Write(w http.ResponseWriter) error {
  8. http.ServeFile(w, r.Request, r.Path)
  9. return nil
  10. }