Skip to content

Unable to mock getty.Session interface, due to composition with unexported functions in getty.Connection. #71

@iSuperCoder

Description

@iSuperCoder

What would you like to be added:
To resolve this problem, it is necessary to modify all the functions defined in getty.Connection to be exported with uppercase names.

Why is this needed:
Seata-go references getty, and encountered obstacles when writing unit tests related to the getty.Session interface. Neither gomock nor gomonkey can mock the getty.Session interface.

The issue arises from the fact that the getty.Connection interface defines lowercase unexported functions, and the getty.Session interface composes getty.Connection, making it impossible to mock getty.Session from outside the getty package.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions