go-cbr-client is a fork of matperez's client for CBRF API.
First, ensure the library is installed and up to date by running
go get -u github.com/ivanglie/go-cbr-client
This is a very simple app that just displays exhange rate of US dollar.
package main
import (
"fmt"
"time"
cbr "github.com/ivanglie/go-cbr-client"
)
func main() {
client := cbr.NewClient()
rate, err := client.GetRate("USD", time.Now())
if err != nil {
panic(err)
}
fmt.Println(rate)
}
Console output:
76.8207
See main.go.
For more information check out the following links: