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/a79ed2ea-5d89-4cb1-9c3f-1e4eb09d78aen%40googlegroups.com.