Use consistent extension names. Close #6.

This commit is contained in:
Andrew Gallant
2013-12-28 10:13:20 -05:00
committed by Přemysl Janouch
parent 33509dbeb0
commit 76f9adb599
11 changed files with 389 additions and 391 deletions

View File

@@ -79,8 +79,7 @@ func (r *Request) CheckExt(c *Context) {
if !c.protocol.isExt() {
return
}
c.Putln("if _, ok := c.Extensions[\"%s\"]; !ok {",
strings.ToUpper(c.protocol.ExtXName))
c.Putln("if _, ok := c.Extensions[\"%s\"]; !ok {", c.protocol.ExtXName)
c.Putln("panic(\"Cannot issue request '%s' using the uninitialized "+
"extension '%s'. %s.Init(connObj) must be called first.\")",
r.SrcName(), c.protocol.ExtXName, c.protocol.PkgName())
@@ -155,8 +154,7 @@ func (r *Request) WriteRequest(c *Context) {
c.Putln("buf := make([]byte, size)")
c.Putln("")
if c.protocol.isExt() {
c.Putln("buf[b] = c.Extensions[\"%s\"]",
strings.ToUpper(c.protocol.ExtXName))
c.Putln("buf[b] = c.Extensions[\"%s\"]", c.protocol.ExtXName)
c.Putln("b += 1")
c.Putln("")
}