Skip to content

I have to use the PgxConnIface interface in my source code? #64

Answered by pashagolub
Nikola-Milovic asked this question in Q&A
Discussion options

You must be logged in to vote

Hello @Nikola-Milovic!

Thanks a lot for your question. Let me answer by quoting the article "Mocking Techniques for Go":

In Go, interfaces are implicitly and statically satisfied by implementing types. That means you do not need to explicitly mention that your type will “implement” an interface. If it can do the behaviors of the interface, it is allowed to be treated that way. The static satisfaction means you find out at compile time whether or not your concrete type can be substituted as an interface type. This is one distinguishing mark from true “duck typing” that you see in dynamic languages like python. Because of this, interfaces are incredibly powerful for mocking in tests. The f…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@Nikola-Milovic
Comment options

@Nikola-Milovic
Comment options

Answer selected by Nikola-Milovic
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
question Further information is requested
2 participants