Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
-
None
Description
Given the following 2 thrift simple thrift files
base.thrift
namespace go base /** Common context for a request containing information about the requester. */ struct RequestContext { /** ID */ 1:required i64 ID } exception WError { /** Identifying code for the error */ 1:i64 code, /** Descriptive error message */ 2:string message, } service BaseService { /** A simple ping to see if the service is alive */ void ping() throws (1:WError err) }
extended.thrift
namespace go extended include "base.thrift" struct Extended { 1:required i64 ID } service ExtendedService extends base.BaseService{ /** Creates the requested Translation. Returns the representation of the created Translation with a generated ID and the userId attached. */ Extended createExtended(1:base.RequestContext rc, 2:Extended ex) throws (1:base.WError err) }
This is a very simple service extending another service. When using thrift (0.9.3, 1.0.0-dev both tested), there is an generation problem that requires fixing by hand.
Running this for generation
thrift -r -gen go:package_prefix=github.com/myrepo/gen-go/ extended.thrift
if I then change directories and run a go build, I get the following error.
$> cd gen-go/extended/extended_service-remote $> go build # github.com/myrepo/gen-go/extended/extended_service-remote ./extended_service-remote.go:134: undefined: extended.NewRequestContext
This is easily reproducible with these steps.
Attachments
Attachments
Issue Links
- is broken by
-
THRIFT-3149 Make ReadFieldN methods in generated Go code private
- Closed
- is duplicated by
-
THRIFT-3411 Go generates remotes with wrong package qualifiers when including
- Closed