From feee8bb8ea692421a92ca0214760d9e6d34314f3 Mon Sep 17 00:00:00 2001 From: Nikhil Saraf <1028334+nikhilsaraf@users.noreply.github.com> Date: Wed, 20 Mar 2019 17:36:12 -0700 Subject: [PATCH] run go fmt and run gofmt -s --- model/assets.go | 4 ++-- plugins/balancedLevelProvider.go | 2 +- plugins/ccxtExchange_test.go | 6 +++--- plugins/factory.go | 12 ++++++------ plugins/sellSideStrategy.go | 2 +- support/networking/endpoint.go | 2 +- 6 files changed, 14 insertions(+), 14 deletions(-) diff --git a/model/assets.go b/model/assets.go index 89383d6ad..644bf0aec 100644 --- a/model/assets.go +++ b/model/assets.go @@ -29,7 +29,7 @@ const ( FEE Asset = "FEE" QTUM Asset = "QTUM" USDT Asset = "USDT" - USDC Asset = "USDC" + USDC Asset = "USDC" DAO Asset = "DAO" ETC Asset = "ETC" ICN Asset = "ICN" @@ -110,7 +110,7 @@ var Display = makeAssetConverter(map[Asset]string{ FEE: string(FEE), QTUM: string(QTUM), USDT: string(USDT), - USDC: string(USDC), + USDC: string(USDC), DAO: string(DAO), ETC: string(ETC), ICN: string(ICN), diff --git a/plugins/balancedLevelProvider.go b/plugins/balancedLevelProvider.go index 68d6c6f51..148f0bdf3 100644 --- a/plugins/balancedLevelProvider.go +++ b/plugins/balancedLevelProvider.go @@ -80,7 +80,7 @@ func makeBalancedLevelProvider( shouldRefresh := true return &balancedLevelProvider{ - spread: spread, + spread: spread, useMaxQuoteInTargetAmountCalc: useMaxQuoteInTargetAmountCalc, minAmountSpread: minAmountSpread, maxAmountSpread: maxAmountSpread, diff --git a/plugins/ccxtExchange_test.go b/plugins/ccxtExchange_test.go index 28ac5f48a..2f6b45f88 100644 --- a/plugins/ccxtExchange_test.go +++ b/plugins/ccxtExchange_test.go @@ -15,7 +15,7 @@ import ( var supportedExchanges = []string{"binance"} var emptyAPIKey = api.ExchangeAPIKey{} var supportedTradingExchanges = map[string]api.ExchangeAPIKey{ - "binance": api.ExchangeAPIKey{}, + "binance": {}, } var testOrderConstraints = map[model.TradingPair]model.OrderConstraints{ @@ -250,8 +250,8 @@ func TestGetOpenOrders_Ccxt(t *testing.T) { } tradingPairs := []model.TradingPair{ - model.TradingPair{Base: model.XLM, Quote: model.BTC}, - model.TradingPair{Base: model.XLM, Quote: model.USDT}, + {Base: model.XLM, Quote: model.BTC}, + {Base: model.XLM, Quote: model.USDT}, } for exchangeName, apiKey := range supportedTradingExchanges { diff --git a/plugins/factory.go b/plugins/factory.go index 18c9172b4..b7e137394 100644 --- a/plugins/factory.go +++ b/plugins/factory.go @@ -34,7 +34,7 @@ type StrategyContainer struct { // strategies is a map of all the strategies available var strategies = map[string]StrategyContainer{ - "buysell": StrategyContainer{ + "buysell": { SortOrder: 1, Description: "Creates buy and sell offers based on a reference price with a pre-specified liquidity depth", NeedsConfig: true, @@ -51,7 +51,7 @@ var strategies = map[string]StrategyContainer{ return s, nil }, }, - "mirror": StrategyContainer{ + "mirror": { SortOrder: 4, Description: "Mirrors an orderbook from another exchange by placing the same orders on Stellar", NeedsConfig: true, @@ -68,7 +68,7 @@ var strategies = map[string]StrategyContainer{ return s, nil }, }, - "sell": StrategyContainer{ + "sell": { SortOrder: 0, Description: "Creates sell offers based on a reference price with a pre-specified liquidity depth", NeedsConfig: true, @@ -85,7 +85,7 @@ var strategies = map[string]StrategyContainer{ return s, nil }, }, - "balanced": StrategyContainer{ + "balanced": { SortOrder: 3, Description: "Dynamically prices two tokens based on their relative demand", NeedsConfig: true, @@ -98,7 +98,7 @@ var strategies = map[string]StrategyContainer{ return makeBalancedStrategy(strategyFactoryData.sdex, strategyFactoryData.tradingPair, strategyFactoryData.ieif, strategyFactoryData.assetBase, strategyFactoryData.assetQuote, &cfg), nil }, }, - "delete": StrategyContainer{ + "delete": { SortOrder: 2, Description: "Deletes all orders for the configured orderbook", NeedsConfig: false, @@ -182,7 +182,7 @@ func loadExchanges() { } exchanges = &map[string]ExchangeContainer{ - "kraken": ExchangeContainer{ + "kraken": { SortOrder: 0, Description: "Kraken is a popular centralized cryptocurrency exchange", TradeEnabled: true, diff --git a/plugins/sellSideStrategy.go b/plugins/sellSideStrategy.go index fc413d6ff..2f292d099 100644 --- a/plugins/sellSideStrategy.go +++ b/plugins/sellSideStrategy.go @@ -265,7 +265,7 @@ func (s *sellSideStrategy) UpdateWithOps(offers []horizon.Offer) (ops []build.Tr // pad the offers so it lines up correctly with numLevelsConsumed. // alternatively we could chop off the beginning of s.currentLevels but then that affects the logging of levels downstream for i := 0; i < numLevelsConsumed; i++ { - offers = append([]horizon.Offer{horizon.Offer{}}, offers...) + offers = append([]horizon.Offer{{}}, offers...) } // next we want to adjust our remaining offers to be in line with what is desired, creating new offers that may not exist at the end of our existing offers diff --git a/support/networking/endpoint.go b/support/networking/endpoint.go index aea38fc6a..d6ef04d3d 100644 --- a/support/networking/endpoint.go +++ b/support/networking/endpoint.go @@ -22,4 +22,4 @@ type Endpoint interface { GetHandlerFunc() http.HandlerFunc GetAuthLevel() AuthLevel GetPath() string -} \ No newline at end of file +}