Skip to content

Instantly share code, notes, and snippets.

@benwoody
Created November 12, 2013 20:40
Show Gist options
  • Save benwoody/7438276 to your computer and use it in GitHub Desktop.
Save benwoody/7438276 to your computer and use it in GitHub Desktop.
field tags with go Structs
...
type MyStruct struct {
MyName string `json:"name"`
}
func (c RenderCorrectJson) Work() revel.Result {
json := MyStruct{MyName: "Ben Woodall"}
return c.RenderJson(json)
}
...
RESULTS:
{
"name": "Ben Woodall"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment