micro optimizations spotted using the go-critic linter

This commit is contained in:
Nicola Murino
2021-02-16 19:11:36 +01:00
parent b1ce6eb85b
commit be9230e85b
29 changed files with 160 additions and 189 deletions

View File

@@ -201,7 +201,7 @@ type actionHandlerStub struct {
called bool
}
func (h *actionHandlerStub) Handle(notification ActionNotification) error {
func (h *actionHandlerStub) Handle(notification *ActionNotification) error {
h.called = true
return nil
@@ -215,7 +215,7 @@ func TestInitializeActionHandler(t *testing.T) {
InitializeActionHandler(&defaultActionHandler{})
})
err := actionHandler.Handle(ActionNotification{})
err := actionHandler.Handle(&ActionNotification{})
assert.NoError(t, err)
assert.True(t, handler.called)