Skip to content

Instantly share code, notes, and snippets.

View lawipac's full-sized avatar
❤️
Happy Developing

Patrick Peng Sun lawipac

❤️
Happy Developing
View GitHub Profile
@lawipac
lawipac / FileServerWith404.go
Created August 7, 2021 10:11 — forked from lummie/FileServerWith404.go
A wrapper for GOs http.FileServer that allows a custom 404 handler to be assigned
package middleware
import (
"net/http"
"os"
"path"
"strings"
)
// FSHandler404 provides the function signature for passing to the FileServerWith404
@lawipac
lawipac / file-upload-multipart.go
Created April 2, 2021 14:10 — forked from andrewmilson/file-upload-multipart.go
Golang multipart/form-data File Upload
package main
import (
"net/http"
"os"
"bytes"
"path"
"path/filepath"
"mime/multipart"
"io"