use &PublicDataService{} to create it as a pointer object and rename ser to srv

This commit is contained in:
Alan.sung 2023-07-31 11:00:38 +09:00
parent cba5663fac
commit b0ccc7e51b

View File

@ -31,8 +31,8 @@ func TestClient_GetInstrumentsRequest(t *testing.T) {
client := NewClient() client := NewClient()
ctx := context.Background() ctx := context.Background()
ser := PublicDataService{client: client} srv := &PublicDataService{client: client}
req := ser.NewGetInstrumentsRequest() req := srv.NewGetInstrumentsRequest()
instruments, err := req. instruments, err := req.
InstrumentType(InstrumentTypeSpot). InstrumentType(InstrumentTypeSpot).
@ -45,8 +45,8 @@ func TestClient_GetInstrumentsRequest(t *testing.T) {
func TestClient_GetFundingRateRequest(t *testing.T) { func TestClient_GetFundingRateRequest(t *testing.T) {
client := NewClient() client := NewClient()
ctx := context.Background() ctx := context.Background()
ser := PublicDataService{client: client} srv := &PublicDataService{client: client}
req := ser.NewGetFundingRate() req := srv.NewGetFundingRate()
instrument, err := req. instrument, err := req.
InstrumentID("BTC-USDT-SWAP"). InstrumentID("BTC-USDT-SWAP").
@ -59,8 +59,8 @@ func TestClient_GetFundingRateRequest(t *testing.T) {
func TestClient_PlaceOrderRequest(t *testing.T) { func TestClient_PlaceOrderRequest(t *testing.T) {
client := getTestClientOrSkip(t) client := getTestClientOrSkip(t)
ctx := context.Background() ctx := context.Background()
ser := TradeService{client: client} srv := &TradeService{client: client}
req := ser.NewPlaceOrderRequest() req := srv.NewPlaceOrderRequest()
order, err := req. order, err := req.
InstrumentID("XTZ-BTC"). InstrumentID("XTZ-BTC").