Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Few question about the client interface. #153

Closed
hsblhsn opened this issue Nov 5, 2021 · 0 comments · Fixed by #154
Closed

Few question about the client interface. #153

hsblhsn opened this issue Nov 5, 2021 · 0 comments · Fixed by #154

Comments

@hsblhsn
Copy link
Contributor

hsblhsn commented Nov 5, 2021

Here, where you have defined the interface,

MakeRequest(
ctx context.Context,
opName string,
query string,
input, retval interface{},
) error

On line 45, we see input, retval interface{}. If I am not wrong, here input means the variables of the query and retval means the reference to the output struct.

So, the first interface is input, and second one is output.

But here in the implementation,

func (c *client) MakeRequest(ctx context.Context, opName string, query string, retval interface{}, variables interface{}) error {

We see the retval, variables interface{}, if i am not wrong the retval means output, and variables means input.

So, the first interface is output, second interface is input.

The problem

On interface definition, the first var is indicating input. But in the implementation, the first var is indicating output.

I am confused.

csilvers pushed a commit that referenced this issue Nov 5, 2021
I was also confused about the variable names (#153). But in this [commit](5995653) it is clear that the first var is output, second var is input. In this commit I have fixed the issue. Fixes #153
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant