Skip to content

PoC: Create struct functions to perform API calls #7

@rbUUbr

Description

@rbUUbr

Currently I have an use-case when I need convert a lot of currencies to another currencies in a row. In my code I need to do something like this:

client := // client creating
for _, currency := range currencies {
  request := client.newRequest(...params)
  rsp, _ := client.do(request)
}

Here is the problem: I need to do a lot of actions to just convert the currency :(

  1. create client
  2. set up request
  3. perform request
    What if this library will have some kind of advanced API to do something like:
client := // client creating
for _, currency := range currencies {
  rsp, _ := client.ConvertCurrency(currency, "USD")
}

WDYT about it?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions