Open dhfherna opened 1 year ago
Hello @dhfherna
It is probably best not to make network calls to solve this problem.
Making API requests to a third party service can fail or behave unexpectedly.
@dhfherna thank you for the PR, although as @LordNoteworthy unfortunately there are many problems that arise when using external services, to start, the machine running the code could not have access to the internet. There is also no guaranteed that the external service will be available, imagine that your code fail because of that, is definitely not a good experience to have. We have similar issues on transient failures in our own tests because we use external services to generate images (which I'm planning to remove in the future).
As alternative, can you move the logic and data to the file itself?
Description My solution consists in consuming an API that allows to query a list of words related to a context, for example, for the context of a pastry shop, we can receive the following result: List: pastry, pastrycook, patissier,: bakeshop, confectionary, cakery, pastry chef, pastrymaker, pasteler, bakery, pastrymaking, boulangerie, croissanterie, bakehouse, cake shop, pieshop, doughnutery, baker's, paste Or if you prefer, a single random word from this list: pastrymaker
Are you trying to fix an existing issue?
143
Go Version
Go Tests