mirror of
https://github.com/kevin-DL/m3o-go.git
synced 2026-01-21 14:35:01 +00:00
Commit from m3o/m3o action
This commit is contained in:
19
examples/currency/convert/convert10UsdToGbp/main.go
Executable file
19
examples/currency/convert/convert10UsdToGbp/main.go
Executable file
@@ -0,0 +1,19 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"go.m3o.com/currency"
|
||||
)
|
||||
|
||||
// Convert returns the currency conversion rate between two pairs e.g USD/GBP
|
||||
func main() {
|
||||
currencyService := currency.NewCurrencyService(os.Getenv("M3O_API_TOKEN"))
|
||||
rsp, err := currencyService.Convert(¤cy.ConvertRequest{
|
||||
Amount: 10,
|
||||
From: "USD",
|
||||
To: "GBP",
|
||||
})
|
||||
fmt.Println(rsp, err)
|
||||
}
|
||||
18
examples/currency/convert/convertUsdToGbp/main.go
Executable file
18
examples/currency/convert/convertUsdToGbp/main.go
Executable file
@@ -0,0 +1,18 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"go.m3o.com/currency"
|
||||
)
|
||||
|
||||
// Convert returns the currency conversion rate between two pairs e.g USD/GBP
|
||||
func main() {
|
||||
currencyService := currency.NewCurrencyService(os.Getenv("M3O_API_TOKEN"))
|
||||
rsp, err := currencyService.Convert(¤cy.ConvertRequest{
|
||||
From: "USD",
|
||||
To: "GBP",
|
||||
})
|
||||
fmt.Println(rsp, err)
|
||||
}
|
||||
Reference in New Issue
Block a user