From e239bb3c68a4981a3916534203c2fbd6b96f593c Mon Sep 17 00:00:00 2001 From: "Andrew Gallant (Ocelot)" Date: Thu, 10 May 2012 12:47:19 -0400 Subject: make resource ids their own individual types. last commit before overhaul to sub-packages --- nexgb/xgbgen/go_error.go | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'nexgb/xgbgen/go_error.go') diff --git a/nexgb/xgbgen/go_error.go b/nexgb/xgbgen/go_error.go index c96866c..f4577ef 100644 --- a/nexgb/xgbgen/go_error.go +++ b/nexgb/xgbgen/go_error.go @@ -68,9 +68,9 @@ func (e *Error) ImplementsError(c *Context) { c.Putln("return err.Sequence") c.Putln("}") c.Putln("") - c.Putln("func (err %s) BadId() Id {", e.ErrType()) + c.Putln("func (err %s) BadId() uint32 {", e.ErrType()) if !c.protocol.isExt() { - c.Putln("return Id(err.BadValue)") + c.Putln("return err.BadValue") } else { c.Putln("return 0") } @@ -128,8 +128,12 @@ func (e *ErrorCopy) ImplementsError(c *Context) { c.Putln("return err.Sequence") c.Putln("}") c.Putln("") - c.Putln("func (err %s) BadId() Id {", e.ErrType()) - c.Putln("return Id(err.BadValue)") + c.Putln("func (err %s) BadId() uint32 {", e.ErrType()) + if !c.protocol.isExt() { + c.Putln("return err.BadValue") + } else { + c.Putln("return 0") + } c.Putln("}") c.Putln("") c.Putln("func (err %s) Error() string {", e.ErrType()) -- cgit v1.2.3-70-g09d2