me-io / go-swap Goto Github PK
View Code? Open in Web Editor NEW๐ฑ Currency exchange rates server - Golang "ฦร"
Home Page: https://go-swap-server.herokuapp.com/swagger/
License: MIT License
๐ฑ Currency exchange rates server - Golang "ฦร"
Home Page: https://go-swap-server.herokuapp.com/swagger/
License: MIT License
Describe the bug
SwapTest := swap.NewSwap()
SwapTest.
AddExchanger(ex.NewGoogleApi(nil)).
AddExchanger(ex.NewYahooApi(nil)).
Build()
euroToUsdRate := SwapTest.Latest("EUR/USD")
fmt.Println(euroToUsdRate.GetRateValue())
fmt.Println(euroToUsdRate.GetRateDateTime())
fmt.Println(euroToUsdRate.GetExchangerName())
I tried to run the example from the repo and got this error.
=== RUN TestCurrencyExchange2
--- FAIL: TestCurrencyExchange2 (0.83s)
panic: runtime error: index out of range [2] with length 0 [recovered]
panic: runtime error: index out of range [2] with length 0
goroutine 6 [running]:
testing.tRunner.func1.1(0x1321400, 0xc0003d2160)
/usr/local/Cellar/go/1.15/libexec/src/testing/testing.go:1057 +0x30d
testing.tRunner.func1(0xc000001b00)
/usr/local/Cellar/go/1.15/libexec/src/testing/testing.go:1060 +0x41a
panic(0x1321400, 0xc0003d2160)
/usr/local/Cellar/go/1.15/libexec/src/runtime/panic.go:969 +0x175
github.com/me-io/go-swap/pkg/exchanger.(*googleApi).Latest(0xc00014e100, 0x13419ec, 0x3, 0x13419f0, 0x3, 0xc00015c160, 0x1, 0x1, 0x2, 0x1342631)
/Volumes/Data/go/pkg/mod/github.com/me-io/[email protected]/pkg/exchanger/google.go:97 +0x353
github.com/me-io/go-swap/pkg/swap.(*Swap).Latest(0xc000040748, 0x13419ec, 0x7, 0x1, 0x2)
/Volumes/Data/go/pkg/mod/github.com/me-io/[email protected]/pkg/swap/swap.go:45 +0x194
github.com/thaitanloi365/swop-backend/tests.TestCurrencyExchange2(0xc000001b00)
/Volumes/Data/Projects/swop-backend/tests/currency_test.go:21 +0x151
testing.tRunner(0xc000001b00, 0x135b4e8)
/usr/local/Cellar/go/1.15/libexec/src/testing/testing.go:1108 +0xef
created by testing.(*T).Run
/usr/local/Cellar/go/1.15/libexec/src/testing/testing.go:1159 +0x386
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.