From cb0d8b42d4b3c26c402a66a0d8b3c25bad6098cb Mon Sep 17 00:00:00 2001 From: Gareth Kirwan Date: Wed, 4 Oct 2023 07:02:16 +0700 Subject: [PATCH] Simplify getTradingFees - remove duplicate var --- exchanges/bitstamp/bitstamp.go | 3 +-- go.mod | 3 +++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/exchanges/bitstamp/bitstamp.go b/exchanges/bitstamp/bitstamp.go index 7e6c6974a61..b3f40687c8d 100644 --- a/exchanges/bitstamp/bitstamp.go +++ b/exchanges/bitstamp/bitstamp.go @@ -85,11 +85,10 @@ func (b *Bitstamp) GetFee(ctx context.Context, feeBuilder *exchange.FeeBuilder) // GetTradingFee returns a trading fee based on a currency func (b *Bitstamp) getTradingFee(ctx context.Context, feeBuilder *exchange.FeeBuilder) (float64, error) { - tradingFees, err := b.GetAccountTradingFee(ctx, feeBuilder.Pair) + fees, err := b.GetAccountTradingFee(ctx, feeBuilder.Pair) if err != nil { return 0, err } - fees := tradingFees fee := fees.Fees.Taker if feeBuilder.IsMaker { fee = fees.Fees.Maker diff --git a/go.mod b/go.mod index bc5d1f70faf..1a1218dfd53 100644 --- a/go.mod +++ b/go.mod @@ -4,6 +4,7 @@ go 1.20 require ( github.com/d5/tengo/v2 v2.16.1 + github.com/davecgh/go-spew v1.1.1 github.com/gofrs/uuid v4.4.0+incompatible github.com/google/go-querystring v1.1.0 github.com/gorilla/mux v1.8.0 @@ -17,6 +18,7 @@ require ( github.com/pquerna/otp v1.4.0 github.com/shopspring/decimal v1.3.1 github.com/spf13/viper v1.16.0 + github.com/stretchr/testify v1.8.3 github.com/thrasher-corp/gct-ta v0.0.0-20200623072738-f2b55b7f9f41 github.com/thrasher-corp/goose v2.7.0-rc4.0.20191002032028-0f2c2a27abdb+incompatible github.com/thrasher-corp/sqlboiler v1.0.1-0.20191001234224-71e17f37a85e @@ -41,6 +43,7 @@ require ( github.com/magiconair/properties v1.8.7 // indirect github.com/mitchellh/mapstructure v1.5.0 // indirect github.com/pelletier/go-toml/v2 v2.0.8 // indirect + github.com/pmezard/go-difflib v1.0.0 // indirect github.com/russross/blackfriday/v2 v2.1.0 // indirect github.com/spf13/afero v1.9.5 // indirect github.com/spf13/cast v1.5.1 // indirect