How do I serve CSS and JS in Go Lang
You can serve a directory of static files like so: http.Handle("/", http.FileServer(http.Dir("css/"))) Would serve your css directory at /. Of course you can serve whichever directory at whatever path you choose. I would probably make sure that the static path isn't in the way of other paths and use something like this. http.Handle("/static/", http.StripPrefix("/static/", http.FileServer(http.Dir("static")))) Placing both your js and css in the directory static in your project. This would then serve them at domain.com/static/css/filename.css and domain.com/static/js/filename.js The StripPrefix method removes the prefix, so it doesn't try to search e.g. in the static directory for static/css/filename.css which, of course, it wouldn't find. It would look for css/filename.css in the static directory, which would be correct.
Appending to multiple instances of a slice
How to apply range on multiple slices in golang Beego template?
How to type convert a slice of type aliases
How to set consistency option in golang etcd client
go http template extra data leaking in the template
What's the point of creating one-way channels in Go
Docker Machine - generic driver does not support start
Why redefining a variable does not always trigger an error?
Functions of interface type returning struct of (another) interface type
How to return a string from JSON to a C caller (Golang CGO)?
How to get an actual file from a blob with git2go / libgit2?
Name for a generated go file
Assigning a variable of reference type “slice” to another variable, why don't they change simultaneously?
Godeps development flow?
How to write these mongo code in go
Type alias for channel in Go works strange