Skip to content
New issue

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

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

Already on GitHub? # to your account

pgxmock.ExpectBegin is not documented #181

Closed
MikeTaylor opened this issue Dec 20, 2023 · 6 comments · Fixed by #182
Closed

pgxmock.ExpectBegin is not documented #181

MikeTaylor opened this issue Dec 20, 2023 · 6 comments · Fixed by #182
Assignees
Labels
documentation Improvements or additions to documentation

Comments

@MikeTaylor
Copy link

I expected to see it in the Functions section at
https://pkg.go.dev/github.com/pashagolub/pgxmock/v3#pkg-functions
but only NewResult and QueryMatcherOption are listed here.

I can't find it anywhere else in the documentation, either.

(BTW., thanks for a really helpful module!)

@pashagolub pashagolub self-assigned this Dec 20, 2023
@pashagolub
Copy link
Owner

Well, it's here https://pkg.go.dev/github.com/pashagolub/pgxmock/v3#ExpectedBegin

The manual looks this way probably because interface is not documented. I'll check what can we do about this

@pashagolub pashagolub added the documentation Improvements or additions to documentation label Dec 20, 2023
@MikeTaylor
Copy link
Author

Thanks for looking into this, @pashagolub. I'm a total newbie with pgxmock, and indeed pgx, so this probably reflects my ignorance more than anything, but I would have expected to see something about the function that creates an object of type ExpectedBegin as well as documentation of the resulting type.

@pashagolub
Copy link
Owner

ok, that is how go doc system works. It ignores public methods if they are not implemented by public struct in the package. sqlmock has the same issue. I'm not sure, how to fix this problem without breaking the code completely.

@MikeTaylor
Copy link
Author

Hmm, that sounds like a bug in go doc to me, but that's obviously not your fault!

Maybe the workaround is to add a description of the interface methods in the text overview?

@pashagolub
Copy link
Owner

Not a bug but a feature. :-)

It seems I can put interface into doc. Let me try something.

pashagolub added a commit that referenced this issue Dec 21, 2023
- rename `pgxMockIface` to `Expecter`
- rename `pgxIface` to `PgxCommonIface`
- move `Config()` methods to proper interfaces
- make `expectation` hidden
@pashagolub pashagolub linked a pull request Dec 21, 2023 that will close this issue
pashagolub added a commit that referenced this issue Dec 21, 2023
* [*] make `Expect*` methods visible in the docs, closes #181
- rename `pgxMockIface` to `Expecter`
- rename `pgxIface` to `PgxCommonIface`
- move `Config()` methods to proper interfaces
- make `expectation` hidden
- cover `pgxmockConn.Config()` with test
@MikeTaylor
Copy link
Author

Thanks for handling this!

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants