Skip to content

Generates code from imported types #52

Description

@smyrman

When running zenrpc in a package that both defines and imports a zenrpc.Service type, then it will generate (incorrect) code for the imported services.

I.e. if having:

cmd/mycmd
    main_zenrpc.go -- generated
    service.go -- defines FooService
    server.go -- register FooService and pkg/bar.Service
pkg/bar
   bar_zenrpc.go -- generated
   service.go -- defines Service

When generating the code in cmd/mycmd then it will generate code for Service (which does not exist in the package) as well as FooService, which does exist. It will also, for some reason, import encoding/json twise. Either way, the result is invalid code.

Maybe related with #35?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions