Training project to teach myself how to use CLI + API call within a go app.
A simple USD to EUR converter written in Go.
It uses exchangeratesapi.io behind the scene, so be sure:
- Create a free account
- Store your API Access Key inside the environment variable "
EXCHANGERATESAPI_ACCESS_KEY
".
export EXCHANGERATESAPI_ACCESS_KEY=<your_exchange_rates_api_access_key>
- Restart your shell
To convert $5 USD to EUR:
$ go run main.go -usd=5
# 📡 Calling Exchangerateapi to get latest rates...
# ✅ Latest rates received: 1 EUR = 1.209715 USD
# 5 USD = 6.0485750000000005 EUR