Last active
March 3, 2018 07:51
-
-
Save farhany/0fbf84e265ec3e6f3502675e83008149 to your computer and use it in GitHub Desktop.
favicon.ico from golang's rice
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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