Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
All platforms
-
Patch Available
Description
Go code generator emits invalid code when a service method is declared to throw an exception, which name is a Go keyword.
To reproduce, create gobug.thrift:
gobug.thrift
exception FooError { }
service Foo {
void bar() throws (1: FooError error)
}
Run:
thrift -gen go gobug.thrift && (cd gen-go/gobug && go build -a)
This should result in the following error:
./foo.go:106: result1.Error undefined (type *BarResult has no field or method Error) ./foo.go:107: type error is not an expression ./foo.go:107: cannot assign to <nil>.error ./foo.go:107: result1.Error undefined (type *BarResult has no field or method Error)