mirror of
https://github.com/d0zingcat/gocryptotrader.git
synced 2026-05-22 07:26:50 +00:00
linter: Enable gofumpt and run against codebase (#1848)
* linter: Enable gofumpt and run against codebase * Address shazbert's nits * gofumpt: Fix issues after rebase
This commit is contained in:
@@ -24,11 +24,11 @@ type Connection interface {
|
||||
// defined in websocket_connection.go.
|
||||
GenerateMessageID(highPrecision bool) int64
|
||||
// SendMessageReturnResponse will send a WS message to the connection and wait for response
|
||||
SendMessageReturnResponse(ctx context.Context, epl request.EndpointLimit, signature any, request any) ([]byte, error)
|
||||
SendMessageReturnResponse(ctx context.Context, epl request.EndpointLimit, signature, request any) ([]byte, error)
|
||||
// SendMessageReturnResponses will send a WS message to the connection and wait for N responses
|
||||
SendMessageReturnResponses(ctx context.Context, epl request.EndpointLimit, signature any, request any, expected int) ([][]byte, error)
|
||||
SendMessageReturnResponses(ctx context.Context, epl request.EndpointLimit, signature, request any, expected int) ([][]byte, error)
|
||||
// SendMessageReturnResponsesWithInspector will send a WS message to the connection and wait for N responses with message inspection
|
||||
SendMessageReturnResponsesWithInspector(ctx context.Context, epl request.EndpointLimit, signature any, request any, expected int, messageInspector Inspector) ([][]byte, error)
|
||||
SendMessageReturnResponsesWithInspector(ctx context.Context, epl request.EndpointLimit, signature, request any, expected int, messageInspector Inspector) ([][]byte, error)
|
||||
// SendRawMessage sends a message over the connection without JSON encoding it
|
||||
SendRawMessage(ctx context.Context, epl request.EndpointLimit, messageType int, message []byte) error
|
||||
// SendJSONMessage sends a JSON encoded message over the connection
|
||||
|
||||
@@ -32,9 +32,7 @@ const (
|
||||
proxyURL = "http://212.186.171.4:80" // Replace with a usable proxy server
|
||||
)
|
||||
|
||||
var (
|
||||
errDastardlyReason = errors.New("some dastardly reason")
|
||||
)
|
||||
var errDastardlyReason = errors.New("some dastardly reason")
|
||||
|
||||
type testStruct struct {
|
||||
Error error
|
||||
@@ -166,7 +164,7 @@ func TestSetup(t *testing.T) {
|
||||
|
||||
func TestConnectionMessageErrors(t *testing.T) {
|
||||
t.Parallel()
|
||||
var wsWrong = &Websocket{}
|
||||
wsWrong := &Websocket{}
|
||||
wsWrong.connector = func() error { return nil }
|
||||
err := wsWrong.Connect()
|
||||
assert.ErrorIs(t, err, ErrWebsocketNotEnabled, "Connect should error correctly")
|
||||
@@ -657,7 +655,7 @@ func TestDial(t *testing.T) {
|
||||
mock := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { mockws.WsMockUpgrader(t, w, r, mockws.EchoHandler) }))
|
||||
defer mock.Close()
|
||||
|
||||
var testCases = []testStruct{
|
||||
testCases := []testStruct{
|
||||
{
|
||||
WC: WebsocketConnection{
|
||||
ExchangeName: "test1",
|
||||
@@ -709,7 +707,7 @@ func TestSendMessage(t *testing.T) {
|
||||
mock := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { mockws.WsMockUpgrader(t, w, r, mockws.EchoHandler) }))
|
||||
defer mock.Close()
|
||||
|
||||
var testCases = []testStruct{
|
||||
testCases := []testStruct{
|
||||
{
|
||||
WC: WebsocketConnection{
|
||||
ExchangeName: "test1",
|
||||
|
||||
Reference in New Issue
Block a user