Skip to content

Commit

Permalink
Run gofumpt
Browse files Browse the repository at this point in the history
  • Loading branch information
9seconds committed Jun 21, 2021
1 parent 47a7a53 commit 0f71cd5
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 19 deletions.
4 changes: 2 additions & 2 deletions auth/ip_whitelist_auth_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ func (suite *IPWhitelistAuthTestSuite) SetupTest() {
_, netv6, _ := net.ParseCIDR("2001:db8:85a3:8d3:1319:8a2e:370:7348/64")

suite.auth, _ = auth.NewIPWhitelist(map[string][]net.IPNet{
"user1": []net.IPNet{*net127, *net192},
"user2": []net.IPNet{*netv6},
"user1": {*net127, *net192},
"user2": {*netv6},
})
}

Expand Down
2 changes: 1 addition & 1 deletion conns/unhijack_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ func (suite *UnhijackTestSuite) TestKeepOpened() {
}

func (suite *UnhijackTestSuite) TestClose() {
suite.raw.On("Close").Return(nil)
suite.raw.On("Close").Return(nil)

conns.FixHijackHandler(func(net.Conn) bool {
return true
Expand Down
1 change: 0 additions & 1 deletion errors/error_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ const errorJSONSchema = `
var errorJSONValidator = func() *gojsonschema.Schema {
loader := gojsonschema.NewStringLoader(errorJSONSchema)
rv, err := gojsonschema.NewSchema(loader)

if err != nil {
panic(err)
}
Expand Down
2 changes: 1 addition & 1 deletion events/event_stream_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ func (suite *EventStreamTestSuite) SetupTest() {
suite.factory = &ProcessorMockFactory{
All: []*ProcessorMock{},
}
suite.stream = events.NewStream(ctx, suite.factory.Make)
suite.stream = events.NewStream(ctx, suite.factory.Make)

sleep()
}
Expand Down
4 changes: 2 additions & 2 deletions headers/headers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ func (suite *HeadersTestSuite) SetupTest() {

suite.NoError(wrapper.Read(strings.NewReader(req)))

suite.hdrs.Reset(wrapper)
suite.NoError(suite.hdrs.Pull())
suite.hdrs.Reset(wrapper)
suite.NoError(suite.hdrs.Pull())
}

func (suite *HeadersTestSuite) TearDownTest() {
Expand Down
5 changes: 2 additions & 3 deletions layers/layer_filter_subnets_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,17 @@ type FilterSubnetLayerTestSuite struct {

func (suite *FilterSubnetLayerTestSuite) SetupTest() {
suite.BaseLayerTestSuite.SetupTest()

}

func (suite *FilterSubnetLayerTestSuite) TestIPv4() {
suite.l, _ = layers.NewFilterSubnetsLayer([]net.IPNet{
net.IPNet{IP: net.ParseIP("127.0.0.1"), Mask: net.CIDRMask(24, 32)},
{IP: net.ParseIP("127.0.0.1"), Mask: net.CIDRMask(24, 32)},
})

suite.Error(suite.l.OnRequest(suite.ctx))

suite.l, _ = layers.NewFilterSubnetsLayer([]net.IPNet{
net.IPNet{IP: net.ParseIP("10.0.0.10"), Mask: net.CIDRMask(24, 32)},
{IP: net.ParseIP("10.0.0.10"), Mask: net.CIDRMask(24, 32)},
})

suite.NoError(suite.l.OnRequest(suite.ctx))
Expand Down
16 changes: 8 additions & 8 deletions opts_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,28 +131,28 @@ func (suite *OptsTestSuite) TestGetTLSSkipVerify() {
func (suite *OptsTestSuite) TestGetLayers() {
suite.Len(suite.o.GetLayers(), 2)

lr := layers.TimeoutLayer{Timeout: time.Second}
lr := layers.TimeoutLayer{Timeout: time.Second}

suite.o.Layers = []layers.Layer{lr}

suite.Len(suite.o.GetLayers(), 3)
suite.Equal(lr, suite.o.GetLayers()[1])
suite.Equal(lr, suite.o.GetLayers()[1])
}

func (suite *OptsTestSuite) TestGetAuthenticator() {
suite.IsType(auth.NoopAuth{}, suite.o.GetAuthenticator())
suite.IsType(auth.NoopAuth{}, suite.o.GetAuthenticator())

suite.o.Authenticator = auth.NewBasicAuth(nil)
suite.o.Authenticator = auth.NewBasicAuth(nil)

suite.Equal(suite.o.Authenticator, suite.o.GetAuthenticator())
suite.Equal(suite.o.Authenticator, suite.o.GetAuthenticator())
}

func (suite *OptsTestSuite) TestGetExecutor() {
suite.Nil(suite.o.GetExecutor())
suite.Nil(suite.o.GetExecutor())

suite.o.Executor = func(_ *layers.Context) error { return nil }
suite.o.Executor = func(_ *layers.Context) error { return nil }

suite.NotNil(suite.o.GetExecutor())
suite.NotNil(suite.o.GetExecutor())
}

func TestOpts(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion upgrades/init_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ func (m *MockConn) SetWriteDeadline(tm time.Time) error {
}

type UpgradesTestSuite struct {
suite.Suite
suite.Suite

up upgrades.Interface
clientConn *MockConn
Expand Down

0 comments on commit 0f71cd5

Please sign in to comment.