Files
m3o-go/examples/currency/rates/getRatesForUsd.go
2021-10-29 06:38:17 +00:00

18 lines
341 B
Go
Executable File

package example
import (
"fmt"
"os"
"github.com/go.m3o.com/currency"
)
// Rates returns the currency rates for a given code e.g USD
func GetRatesForUsd() {
currencyService := currency.NewCurrencyService(os.Getenv("M3O_API_TOKEN"))
rsp, err := currencyService.Rates(&currency.RatesRequest{
Code: "USD",
})
fmt.Println(rsp, err)
}