Giter VIP home page Giter VIP logo

me-io / go-swap Goto Github PK

View Code? Open in Web Editor NEW
37.0 37.0 4.0 279 KB

๐Ÿ’ฑ Currency exchange rates server - Golang "ฦ“ร˜"

Home Page: https://go-swap-server.herokuapp.com/swagger/

License: MIT License

Shell 6.82% Go 78.20% Makefile 11.57% HTML 3.42%
currency currency-converter currency-exchange currency-exchange-rates currency-rates currencylayer exchange exchange-rates fixer golang money

go-swap's People

Contributors

meabed avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

go-swap's Issues

Google Exchanger Error

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.