mirror of
https://github.com/jhillyerd/inbucket.git
synced 2025-12-21 19:47:03 +00:00
chore: fix more capitalization style warnings (#487)
Signed-off-by: James Hillyerd <james@hillyerd.com>
This commit is contained in:
@@ -47,13 +47,13 @@ func TestAsyncBrokerEmitCallsMultipleListeners(t *testing.T) {
|
||||
want := "hi"
|
||||
broker.Emit(&want)
|
||||
|
||||
first_got, err := first()
|
||||
firstGot, err := first()
|
||||
require.NoError(t, err)
|
||||
assert.Equal(t, want, *first_got)
|
||||
assert.Equal(t, want, *firstGot)
|
||||
|
||||
second_got, err := second()
|
||||
secondGot, err := second()
|
||||
require.NoError(t, err)
|
||||
assert.Equal(t, want, *second_got)
|
||||
assert.Equal(t, want, *secondGot)
|
||||
}
|
||||
|
||||
func TestAsyncBrokerAddingDuplicateNameReplacesPrevious(t *testing.T) {
|
||||
@@ -66,13 +66,13 @@ func TestAsyncBrokerAddingDuplicateNameReplacesPrevious(t *testing.T) {
|
||||
want := "hi"
|
||||
broker.Emit(&want)
|
||||
|
||||
first_got, err := first()
|
||||
firstGot, err := first()
|
||||
require.Error(t, err)
|
||||
assert.Nil(t, first_got)
|
||||
assert.Nil(t, firstGot)
|
||||
|
||||
second_got, err := second()
|
||||
secondGot, err := second()
|
||||
require.NoError(t, err)
|
||||
assert.Equal(t, want, *second_got)
|
||||
assert.Equal(t, want, *secondGot)
|
||||
}
|
||||
|
||||
func TestAsyncBrokerRemovingListenerSuccessful(t *testing.T) {
|
||||
@@ -86,13 +86,13 @@ func TestAsyncBrokerRemovingListenerSuccessful(t *testing.T) {
|
||||
want := "hi"
|
||||
broker.Emit(&want)
|
||||
|
||||
first_got, err := first()
|
||||
firstGot, err := first()
|
||||
require.Error(t, err)
|
||||
assert.Nil(t, first_got)
|
||||
assert.Nil(t, firstGot)
|
||||
|
||||
second_got, err := second()
|
||||
secondGot, err := second()
|
||||
require.NoError(t, err)
|
||||
assert.Equal(t, want, *second_got)
|
||||
assert.Equal(t, want, *secondGot)
|
||||
}
|
||||
|
||||
func TestAsyncBrokerRemovingMissingListener(t *testing.T) {
|
||||
|
||||
@@ -28,13 +28,13 @@ func TestBrokerEmitCallsMultipleListeners(t *testing.T) {
|
||||
broker := &extension.EventBroker[string, bool]{}
|
||||
|
||||
// Setup listeners.
|
||||
var first_got, second_got string
|
||||
var firstGot, secondGot string
|
||||
first := func(s string) *bool {
|
||||
first_got = s
|
||||
firstGot = s
|
||||
return nil
|
||||
}
|
||||
second := func(s string) *bool {
|
||||
second_got = s
|
||||
secondGot = s
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -43,11 +43,11 @@ func TestBrokerEmitCallsMultipleListeners(t *testing.T) {
|
||||
|
||||
want := "hi"
|
||||
broker.Emit(&want)
|
||||
if first_got != want {
|
||||
t.Errorf("first got %q, want %q", first_got, want)
|
||||
if firstGot != want {
|
||||
t.Errorf("first got %q, want %q", firstGot, want)
|
||||
}
|
||||
if second_got != want {
|
||||
t.Errorf("second got %q, want %q", second_got, want)
|
||||
if secondGot != want {
|
||||
t.Errorf("second got %q, want %q", secondGot, want)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -77,13 +77,13 @@ func TestBrokerAddingDuplicateNameReplacesPrevious(t *testing.T) {
|
||||
broker := &extension.EventBroker[string, bool]{}
|
||||
|
||||
// Setup listeners.
|
||||
var first_got, second_got string
|
||||
var firstGot, secondGot string
|
||||
first := func(s string) *bool {
|
||||
first_got = s
|
||||
firstGot = s
|
||||
return nil
|
||||
}
|
||||
second := func(s string) *bool {
|
||||
second_got = s
|
||||
secondGot = s
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -92,11 +92,11 @@ func TestBrokerAddingDuplicateNameReplacesPrevious(t *testing.T) {
|
||||
|
||||
want := "hi"
|
||||
broker.Emit(&want)
|
||||
if first_got != "" {
|
||||
t.Errorf("first got %q, want empty string", first_got)
|
||||
if firstGot != "" {
|
||||
t.Errorf("first got %q, want empty string", firstGot)
|
||||
}
|
||||
if second_got != want {
|
||||
t.Errorf("second got %q, want %q", second_got, want)
|
||||
if secondGot != want {
|
||||
t.Errorf("second got %q, want %q", secondGot, want)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -104,13 +104,13 @@ func TestBrokerRemovingListenerSuccessful(t *testing.T) {
|
||||
broker := &extension.EventBroker[string, bool]{}
|
||||
|
||||
// Setup listeners.
|
||||
var first_got, second_got string
|
||||
var firstGot, secondGot string
|
||||
first := func(s string) *bool {
|
||||
first_got = s
|
||||
firstGot = s
|
||||
return nil
|
||||
}
|
||||
second := func(s string) *bool {
|
||||
second_got = s
|
||||
secondGot = s
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -120,11 +120,11 @@ func TestBrokerRemovingListenerSuccessful(t *testing.T) {
|
||||
|
||||
want := "hi"
|
||||
broker.Emit(&want)
|
||||
if first_got != "" {
|
||||
t.Errorf("first got %q, want empty string", first_got)
|
||||
if firstGot != "" {
|
||||
t.Errorf("first got %q, want empty string", firstGot)
|
||||
}
|
||||
if second_got != want {
|
||||
t.Errorf("second got %q, want %q", second_got, want)
|
||||
if secondGot != want {
|
||||
t.Errorf("second got %q, want %q", secondGot, want)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -55,7 +55,7 @@ func unwrapInboundMessage(lv lua.LValue) (*event.InboundMessage, error) {
|
||||
}
|
||||
}
|
||||
|
||||
return nil, fmt.Errorf("Expected InboundMessage, got %q", lv.Type().String())
|
||||
return nil, fmt.Errorf("expected InboundMessage, got %q", lv.Type().String())
|
||||
}
|
||||
|
||||
// Gets a field value from InboundMessage user object. This emulates a Lua table,
|
||||
|
||||
@@ -37,7 +37,7 @@ func New(conf config.Lua, extHost *extension.Host) (*Host, error) {
|
||||
logger.Info().Msg("Script file not found")
|
||||
return nil, nil
|
||||
} else if fi.IsDir() {
|
||||
return nil, fmt.Errorf("Lua script %v is a directory", scriptPath)
|
||||
return nil, fmt.Errorf("lua script %v is a directory", scriptPath)
|
||||
}
|
||||
|
||||
logger.Info().Msg("Loading script")
|
||||
|
||||
Reference in New Issue
Block a user