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:
Adrian Gallagher
2025-03-18 10:23:16 +11:00
committed by GitHub
parent 748ed71455
commit f5faca2eb2
189 changed files with 1541 additions and 1104 deletions

View File

@@ -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",