Files
services/examples/currency/convert/go/convertUsdToGbp.go
2021-09-16 12:52:36 +01:00

18 lines
394 B
Go
Executable File

package example
import (
"fmt"
"github.com/micro/services/clients/go/currency"
"os"
)
// Convert returns the currency conversion rate between two pairs e.g USD/GBP
func ConvertUsdToGbp() {
currencyService := currency.NewCurrencyService(os.Getenv("MICRO_API_TOKEN"))
rsp, err := currencyService.Convert(&currency.ConvertRequest{
From: "USD",
To: "GBP",
})
fmt.Println(rsp, err)
}