mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-21 22:43:52 +00:00
all: reformat code
This commit is contained in:
parent
8e426ca4bf
commit
f7a5c84768
2
pkg/cache/cache.go
vendored
2
pkg/cache/cache.go
vendored
|
@ -175,4 +175,4 @@ func loadMarketsFromFile(ctx context.Context, ex types.Exchange) (markets types.
|
||||||
return ex.QueryMarkets(ctx)
|
return ex.QueryMarkets(ctx)
|
||||||
})
|
})
|
||||||
return markets, err
|
return markets, err
|
||||||
}
|
}
|
||||||
|
|
|
@ -59,4 +59,4 @@ func (store *MemoryStore) Reset() error {
|
||||||
|
|
||||||
delete(store.memory.Slots, store.Key)
|
delete(store.memory.Slots, store.Key)
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,4 +26,4 @@ type RedisPersistenceConfig struct {
|
||||||
|
|
||||||
type JsonPersistenceConfig struct {
|
type JsonPersistenceConfig struct {
|
||||||
Directory string `yaml:"directory" json:"directory"`
|
Directory string `yaml:"directory" json:"directory"`
|
||||||
}
|
}
|
||||||
|
|
|
@ -109,4 +109,4 @@ func (store *RedisStore) Save(val interface{}) error {
|
||||||
func (store *RedisStore) Reset() error {
|
func (store *RedisStore) Reset() error {
|
||||||
_, err := store.redis.Del(context.Background(), store.ID).Result()
|
_, err := store.redis.Del(context.Background(), store.ID).Result()
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
|
@ -90,4 +90,4 @@ func TestGrid_HasPrice_Dnum(t *testing.T) {
|
||||||
assert.True(t, grid.HasPrice(number("36.666")), "found 36.666 price ok")
|
assert.True(t, grid.HasPrice(number("36.666")), "found 36.666 price ok")
|
||||||
})
|
})
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -90,4 +90,4 @@ func TestGrid_HasPrice(t *testing.T) {
|
||||||
assert.True(t, grid.HasPrice(number("36.666")), "found 36.666 price ok")
|
assert.True(t, grid.HasPrice(number("36.666")), "found 36.666 price ok")
|
||||||
})
|
})
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -213,4 +213,4 @@ func Test_calculateArithmeticPins(t *testing.T) {
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -210,4 +210,4 @@ func registerMetrics() {
|
||||||
metricsGridFilledOrderPrice,
|
metricsGridFilledOrderPrice,
|
||||||
)
|
)
|
||||||
metricsRegistered = true
|
metricsRegistered = true
|
||||||
}
|
}
|
||||||
|
|
|
@ -1240,7 +1240,7 @@ func Test_buildPinOrderMap(t *testing.T) {
|
||||||
|
|
||||||
t.Run("successful case", func(t *testing.T) {
|
t.Run("successful case", func(t *testing.T) {
|
||||||
openOrders := []types.Order{
|
openOrders := []types.Order{
|
||||||
types.Order{
|
{
|
||||||
SubmitOrder: types.SubmitOrder{
|
SubmitOrder: types.SubmitOrder{
|
||||||
Symbol: s.Symbol,
|
Symbol: s.Symbol,
|
||||||
Side: types.SideTypeBuy,
|
Side: types.SideTypeBuy,
|
||||||
|
@ -1275,7 +1275,7 @@ func Test_buildPinOrderMap(t *testing.T) {
|
||||||
|
|
||||||
t.Run("there is one order with non-pin price in openOrders", func(t *testing.T) {
|
t.Run("there is one order with non-pin price in openOrders", func(t *testing.T) {
|
||||||
openOrders := []types.Order{
|
openOrders := []types.Order{
|
||||||
types.Order{
|
{
|
||||||
SubmitOrder: types.SubmitOrder{
|
SubmitOrder: types.SubmitOrder{
|
||||||
Symbol: s.Symbol,
|
Symbol: s.Symbol,
|
||||||
Side: types.SideTypeBuy,
|
Side: types.SideTypeBuy,
|
||||||
|
@ -1301,7 +1301,7 @@ func Test_buildPinOrderMap(t *testing.T) {
|
||||||
|
|
||||||
t.Run("there are duplicated open orders at same pin", func(t *testing.T) {
|
t.Run("there are duplicated open orders at same pin", func(t *testing.T) {
|
||||||
openOrders := []types.Order{
|
openOrders := []types.Order{
|
||||||
types.Order{
|
{
|
||||||
SubmitOrder: types.SubmitOrder{
|
SubmitOrder: types.SubmitOrder{
|
||||||
Symbol: s.Symbol,
|
Symbol: s.Symbol,
|
||||||
Side: types.SideTypeBuy,
|
Side: types.SideTypeBuy,
|
||||||
|
@ -1320,7 +1320,7 @@ func Test_buildPinOrderMap(t *testing.T) {
|
||||||
ExecutedQuantity: number(0.0),
|
ExecutedQuantity: number(0.0),
|
||||||
IsWorking: false,
|
IsWorking: false,
|
||||||
},
|
},
|
||||||
types.Order{
|
{
|
||||||
SubmitOrder: types.SubmitOrder{
|
SubmitOrder: types.SubmitOrder{
|
||||||
Symbol: s.Symbol,
|
Symbol: s.Symbol,
|
||||||
Side: types.SideTypeBuy,
|
Side: types.SideTypeBuy,
|
||||||
|
|
Loading…
Reference in New Issue
Block a user