Renames Negotiate.HTMLPath to Negotiate.HTMLName

This commit is contained in:
Manu Mtz-Almeida 2015-05-18 20:52:26 +02:00
parent 6313545df7
commit c467186d20
1 changed files with 2 additions and 5 deletions

View File

@ -420,7 +420,7 @@ func (c *Context) Stream(step func(w io.Writer) bool) {
type Negotiate struct { type Negotiate struct {
Offered []string Offered []string
HTMLPath string HTMLName string
HTMLData interface{} HTMLData interface{}
JSONData interface{} JSONData interface{}
XMLData interface{} XMLData interface{}
@ -434,11 +434,8 @@ func (c *Context) Negotiate(code int, config Negotiate) {
c.JSON(code, data) c.JSON(code, data)
case binding.MIMEHTML: case binding.MIMEHTML:
if len(config.HTMLPath) == 0 {
panic("negotiate config is wrong. html path is needed")
}
data := chooseData(config.HTMLData, config.Data) data := chooseData(config.HTMLData, config.Data)
c.HTML(code, config.HTMLPath, data) c.HTML(code, config.HTMLName, data)
case binding.MIMEXML: case binding.MIMEXML:
data := chooseData(config.XMLData, config.Data) data := chooseData(config.XMLData, config.Data)