Skip to content

Instantly share code, notes, and snippets.

@farhany
Last active March 3, 2018 07:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save farhany/0fbf84e265ec3e6f3502675e83008149 to your computer and use it in GitHub Desktop.
Save farhany/0fbf84e265ec3e6f3502675e83008149 to your computer and use it in GitHub Desktop.
favicon.ico from golang's rice
func FavIcon(w http.ResponseWriter, r *http.Request) {
StaticBox := rice.MustFindBox("static")
faviconContent, _ := StaticBox.HTTPBox().Open(r.URL.Path)
http.ServeContent(w, r, r.URL.Path, time.Now(), faviconContent)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment