If someone will be useful https://github.com/takama/ecbrates
package main
import (
"fmt"
"log"
"github.com/takama/ecbrates"
)
func main() {
r, err := ecbrates.New()
if err != nil {
log.Fatal("Error: ", err)
}
// Case 1: get dollar rate relative to euro
fmt.Println("Exchange rate", r.Date, ": EUR 1 -> USD", r.Rate[ecbrates.USD])
// Case 2: convert of 100 euros to dollars
fmt.Println(
"Exchange rate", r.Date,
": EUR 100.0 -> USD", r.Convert(100, ecbrates.EUR, ecbrates.USD),
)
}
thanks
--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.