From 085cbb6402cecb25450f0999fb6097cbc2106bba Mon Sep 17 00:00:00 2001 From: Neur0toxine Date: Tue, 24 Aug 2021 10:06:17 +0300 Subject: [PATCH] fix for tests, update test matrix --- .github/workflows/ci.yml | 2 +- messenger.go | 4 ++-- messenger_test.go | 12 ++++++------ 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8a4beee..ccd5d3f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -29,7 +29,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - go-version: ['1.11', '1.12', '1.13', '1.14', '1.15'] + go-version: ['1.11', '1.12', '1.13', '1.14', '1.15', '1.16', '1.17'] steps: - name: Set up Go ${{ matrix.go-version }} uses: actions/setup-go@v2 diff --git a/messenger.go b/messenger.go index 52d6a7f..bc23cba 100644 --- a/messenger.go +++ b/messenger.go @@ -374,7 +374,7 @@ func (m *Messenger) dispatch(r Receive) { } resp := &Response{ - to: Recipient{info.Sender.ID}, + to: Recipient{ID: info.Sender.ID}, token: m.token, sendAPIVersion: m.sendAPIVersion, } @@ -436,7 +436,7 @@ func (m *Messenger) dispatch(r Receive) { // Response returns new Response object. func (m *Messenger) Response(to int64) *Response { return &Response{ - to: Recipient{to}, + to: Recipient{ID: to}, token: m.token, sendAPIVersion: m.sendAPIVersion, } diff --git a/messenger_test.go b/messenger_test.go index 7633894..3166162 100644 --- a/messenger_test.go +++ b/messenger_test.go @@ -106,7 +106,7 @@ func TestMessenger_Dispatch(t *testing.T) { messages := []MessageInfo{ { Sender: Sender{111}, - Recipient: Recipient{222}, + Recipient: Recipient{ID: 222}, // 2018-11-24 21:31:51 UTC + 999ms Timestamp: 1543095111999, Message: &Message{}, @@ -138,7 +138,7 @@ func TestMessenger_Dispatch(t *testing.T) { messages := []MessageInfo{ { Sender: Sender{111}, - Recipient: Recipient{222}, + Recipient: Recipient{ID: 222}, // 2018-11-24 21:31:51 UTC + 999ms Timestamp: 1543095111999, Delivery: &Delivery{}, @@ -170,7 +170,7 @@ func TestMessenger_Dispatch(t *testing.T) { messages := []MessageInfo{ { Sender: Sender{111}, - Recipient: Recipient{222}, + Recipient: Recipient{ID: 222}, // 2018-11-24 21:31:51 UTC + 999ms Timestamp: 1543095111999, Read: &Read{}, @@ -205,7 +205,7 @@ func TestMessenger_Dispatch(t *testing.T) { messages := []MessageInfo{ { Sender: Sender{111}, - Recipient: Recipient{222}, + Recipient: Recipient{ID: 222}, // 2018-11-24 21:31:51 UTC + 999ms Timestamp: 1543095111999, PostBack: &PostBack{}, @@ -240,7 +240,7 @@ func TestMessenger_Dispatch(t *testing.T) { messages := []MessageInfo{ { Sender: Sender{111}, - Recipient: Recipient{222}, + Recipient: Recipient{ID: 222}, // 2018-11-24 21:31:51 UTC + 999ms Timestamp: 1543095111999, OptIn: &OptIn{}, @@ -275,7 +275,7 @@ func TestMessenger_Dispatch(t *testing.T) { messages := []MessageInfo{ { Sender: Sender{111}, - Recipient: Recipient{222}, + Recipient: Recipient{ID: 222}, // 2018-11-24 21:31:51 UTC + 999ms Timestamp: 1543095111999, ReferralMessage: &ReferralMessage{},