You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Render is a package that provides functionality for easily rendering JSON, XML, text, binary data, and HTML templates. This package is based on the [Martini](https://github.com/go-martini/martini)[render](https://github.com/martini-contrib/render) work.
5
-
6
-
## Block Deprecation Notice
7
-
Go 1.6 introduces a new [block](https://github.com/golang/go/blob/release-branch.go1.6/src/html/template/example_test.go#L128) action. This conflicts with Render's included `block` template function. To provide an easy migration path, a new function was created called `partial`. It is a duplicate of the old `block` function. It is advised that all users of the `block` function update their code to avoid any issues in the future. Previous to Go 1.6, Render's `block` functionality will continue to work but a message will be logged urging you to migrate to the new `partial` function.
4
+
Render is a package that provides functionality for easily rendering JSON, XML, text, binary data, and HTML templates.
8
5
9
6
## Usage
10
7
Render can be used with pretty much any web framework providing you can access the `http.ResponseWriter` from your handler. The rendering functions simply wraps Go's existing functionality for marshaling and rendering data.
@@ -23,7 +20,7 @@ import (
23
20
"encoding/xml"
24
21
"net/http"
25
22
26
-
"github.com/unrolled/render"// or "gopkg.in/unrolled/render.v1"
23
+
"github.com/unrolled/render"
27
24
)
28
25
29
26
typeExampleXmlstruct {
@@ -101,6 +98,7 @@ r := render.New(render.Options{
101
98
PrefixXML: []byte("<?xml version='1.0' encoding='UTF-8'?>"), // Prefixes XML responses with the given bytes.
102
99
HTMLContentType: "application/xhtml+xml", // Output XHTML content type instead of default "text/html".
103
100
IsDevelopment: true, // Render will now recompile the templates on every HTML response.
101
+
UseMutexLock: true, // Overrides the default no lock implementation and uses the standard `sync.RWMutex` lock.
0 commit comments