]> git.giacomolli.uk - onechat/blobdiff - whatsapp_test.go
Separate returns from longer statement blocks
[onechat] / whatsapp_test.go
index db04dc7424737406782dbb439f365b3db0279e39..dca137b8a55bf6d2dd2d87ea2f8cd206087e3170 100644 (file)
@@ -143,7 +143,8 @@ func TestWhatsAppFirstConnectionRetriesStopForLinkChanges(t *testing.T) {
                {
                        name: "unlink",
                        stop: func(test *WhatsAppRetryTest) {
                {
                        name: "unlink",
                        stop: func(test *WhatsAppRetryTest) {
-                               test.whatsapp.Command("unlink", func(text string) {})
+                               test.whatsapp.Command("unlink", func(_ string) {
+                               })
                        },
                },
                {
                        },
                },
                {
@@ -183,14 +184,16 @@ func TestWhatsAppPairsAfterFirstConnectionRetriesStop(t *testing.T) {
                test.fake.connectErr = errors.New("network unavailable")
                test.start(t)
                synctest.Wait()
                test.fake.connectErr = errors.New("network unavailable")
                test.start(t)
                synctest.Wait()
-               test.whatsapp.Command("unlink", func(text string) {})
+               test.whatsapp.Command("unlink", func(_ string) {
+               })
                synctest.Wait()
                require.False(t, test.whatsapp.isLinked())
 
                test.fake.mutex.Lock()
                test.fake.connectErr = nil
                test.fake.mutex.Unlock()
                synctest.Wait()
                require.False(t, test.whatsapp.isLinked())
 
                test.fake.mutex.Lock()
                test.fake.connectErr = nil
                test.fake.mutex.Unlock()
-               test.whatsapp.Command("pair 15550001111", func(text string) {})
+               test.whatsapp.Command("pair 15550001111", func(_ string) {
+               })
                items := <-test.fake.pairings
                items <- whatsmeow.QRChannelItem{Event: whatsmeow.QRChannelEventCode}
                synctest.Wait()
                items := <-test.fake.pairings
                items <- whatsmeow.QRChannelItem{Event: whatsmeow.QRChannelEventCode}
                synctest.Wait()
@@ -298,7 +301,7 @@ func TestWhatsAppIsNotLinkedWithoutALinkedDevice(t *testing.T) {
        }{
                {
                        name: "no session file",
        }{
                {
                        name: "no session file",
-                       session: func(t *testing.T, dir string) {
+                       session: func(_ *testing.T, _ string) {
                        },
                },
                {
                        },
                },
                {