INNER CODE UNIT · Go
func
yarpc/yarpc-go · encoding/thrift/thriftrw-plugin-yarpc/main.go:105
func (g g) Generate(req *api.GenerateServiceRequest) (*api.GenerateServiceResponse, error) {
// moduleGenerators apply to all Thrift IDL files, even when no service
// definition exists
moduleGenerators := []moduleGenFunc{yarpcErrorGenerator, yarpcUUIDGenerator}
// serviceGenerators apply only when one or more services are defined in the
// Thrift IDL file.
serviceGenerators := []serviceGenFunc{clientGenerator, serverGenerator}
if !*_noFx {
serviceGenerators = append(serviceGenerators, fxGenerator)
}
if !*_noGomock {
serviceGenerators = append(serviceGenerators, gomockGenerator)
}
if !(*_mockLibrary == _golangMock || *_mockLibrary == _uberMock) {
return nil, fmt.Errorf("%q specified as mock-library. expected %q or %q", *_mockLibrary, _golangMock, _uberMock)
}