This:
> "I want to be able to mock every function in my library."
is a bit confusing. Normally, you want to mock the functions that your 
library calls, not your own library functions.

Other than that, this seems pretty doable.. Can you give some more 
clarification as to what aspect is giving you trouble?
On Thursday, June 6, 2024 at 2:27:53 AM UTC-4 Marcello H wrote:

> Normally, the way to use the functions/methods of the external library is 
> by having an interface with all the function definitions.
>
> Then you can generate a mock that offers the same functionality.
> With such a mock, you can give all kinds of results back to the caller.
>
> Do you have your project in a public GIT?
>
> Op woensdag 5 juni 2024 om 15:41:03 UTC+2 schreef Ai Readone:
>
>> Hello Everyone,
>>
>> I am currently writing a go library that Integrates various Google cloud 
>> services.
>>
>> The aim of the library is to eliminate duplicate implementations across 
>> various services of the same software.
>>
>>
>> I am having challenges on how to write a comprehensive test for my 
>> library, the main challenges are coming from testing function and methods 
>> that performs remote call to Google cloud APIs
>>
>> I want to be able to mock every function in my library.
>>
>> I am familiar with majorly table-testing technique but I am open 
>> to suggestions that requires me to learn new technologies too.
>>
>> Thanks in advance for your time and help.
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/f2216db5-5382-412d-bb33-2041e939ecc6n%40googlegroups.com.

Reply via email to