Mocking package methods for testing

I want to test a function which uses the pgxpool package.
Inside the function, I get a connection (*Conn) from the Acquire method.
Then I use Release and Exec on this connection.
How to mock these two methods?

An answer to a similar request with os package functions suggests to create a variable to overwrite the os.Create function.

var osCreate = os.Create

How to do this with pgxpool.Release ?
Thanks

My guess is that it must be possible to overwrite the symbol table, temporarily, and that there are packages that do that.