From 77f994b4d691aefc7be2e181c4b3b7c7dcbbf60b Mon Sep 17 00:00:00 2001 From: Greg Holmes Date: Sat, 3 Oct 2020 15:43:52 +0100 Subject: [PATCH] Use irc-bot v4 --- cmd/github/main.go | 6 +++--- cmd/github/main_test.go | 2 +- cmd/github/push_test.go | 2 +- cmd/github/webhook_test.go | 14 +++----------- go.mod | 5 +++-- go.sum | 8 ++++---- 6 files changed, 15 insertions(+), 22 deletions(-) diff --git a/cmd/github/main.go b/cmd/github/main.go index 09e4dc0..44b672d 100644 --- a/cmd/github/main.go +++ b/cmd/github/main.go @@ -7,9 +7,9 @@ import ( "encoding/hex" "flag" "fmt" - "github.com/greboid/irc/v3/logger" - "github.com/greboid/irc/v3/plugins" - "github.com/greboid/irc/v3/rpc" + "github.com/greboid/irc-bot/v4/plugins" + "github.com/greboid/irc-bot/v4/rpc" + "github.com/greboid/irc/v4/logger" "github.com/kouhin/envflag" "go.uber.org/zap" "net/http" diff --git a/cmd/github/main_test.go b/cmd/github/main_test.go index 30b6eb6..27fa991 100644 --- a/cmd/github/main_test.go +++ b/cmd/github/main_test.go @@ -5,7 +5,7 @@ import ( "encoding/json" "errors" "fmt" - "github.com/greboid/irc/v2/rpc" + "github.com/greboid/irc-bot/v4/rpc" "google.golang.org/grpc" "io/ioutil" ) diff --git a/cmd/github/push_test.go b/cmd/github/push_test.go index 21c4bd8..d4e8a6b 100644 --- a/cmd/github/push_test.go +++ b/cmd/github/push_test.go @@ -1,7 +1,7 @@ package main import ( - "github.com/greboid/irc/v2/rpc" + "github.com/greboid/irc-bot/v4/rpc" "github.com/sebdah/goldie/v2" "reflect" "strings" diff --git a/cmd/github/webhook_test.go b/cmd/github/webhook_test.go index 9982604..c8b3f5c 100644 --- a/cmd/github/webhook_test.go +++ b/cmd/github/webhook_test.go @@ -2,8 +2,6 @@ package main import ( "errors" - "github.com/greboid/irc/v2/logger" - "go.uber.org/zap" "reflect" "testing" "time" @@ -110,10 +108,7 @@ func Test_githubWebhookHandler_handleWebhook(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { tt.client.finished = tt.finished - g := &githubWebhookHandler{ - client: tt.client, - log: logger.CreateLogger(false), - } + g := &githubWebhookHandler{} var bodyBytes []byte if tt.args.filename != "" { bodyBytes, _ = getTestDataBytes(tt.args.filename) @@ -160,11 +155,8 @@ func Test_githubWebhookHandler_sendMessage(t *testing.T) { } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - g := &githubWebhookHandler{ - client: tt.client, - log: zap.NewNop().Sugar(), - } - got := g.sendMessage(tt.messages, false) + g := &githubWebhookHandler{} + got := g.sendMessage(false, tt.messages...) if !reflect.DeepEqual(got, tt.wanted) { t.Errorf("sendMessage() sent = %v, wanted %v", got, tt.wanted) } diff --git a/go.mod b/go.mod index a5459b0..0aa238c 100644 --- a/go.mod +++ b/go.mod @@ -1,9 +1,10 @@ -module github.com/greboid/irc-github/v3 +module github.com/greboid/irc-github/v4 go 1.15 require ( - github.com/greboid/irc/v3 v3.0.1 + github.com/greboid/irc-bot/v4 v4.0.0 + github.com/greboid/irc/v4 v4.0.0 github.com/kouhin/envflag v0.0.0-20150818174321-0e9a86061649 github.com/sebdah/goldie/v2 v2.5.1 go.uber.org/zap v1.16.0 diff --git a/go.sum b/go.sum index adf6e25..9720a2a 100644 --- a/go.sum +++ b/go.sum @@ -106,10 +106,10 @@ github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hf github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= -github.com/greboid/irc/v2 v2.0.3 h1:11R6FT85HszZSfQL+cCT5jGGtg+70W8r3H9lbj/IOAI= -github.com/greboid/irc/v2 v2.0.3/go.mod h1:wG5xtqTL0sBVow9LZw+16M8lZrv+D4IaywXl9H8w3qk= -github.com/greboid/irc/v3 v3.0.1 h1:aSoKDnC0P3eXaUk/OLg7QzJfBF4E47XwcLmufvllhsQ= -github.com/greboid/irc/v3 v3.0.1/go.mod h1:gnc8yyD5npBR4H2uLsPliihaT4Qhu5rtPhdQTMC3VjQ= +github.com/greboid/irc-bot/v4 v4.0.0 h1:gGU3a6D2fFvLYpOszcVAayiSiSOl3jE/4TusFkB6hHQ= +github.com/greboid/irc-bot/v4 v4.0.0/go.mod h1:ylwr4/+6zAx+KCYoP6nXhBeZ1HzE8I/qsNFZm59YBCU= +github.com/greboid/irc/v4 v4.0.0 h1:iZIwdjyCi6aGMb2WQnOsOFyZcvvHOqFDPVLbF5Y01v0= +github.com/greboid/irc/v4 v4.0.0/go.mod h1:Qb7pgbXnv57ypeRs+LoZCCZcM0ts5iUpLFRxJJyXa2g= github.com/grpc-ecosystem/go-grpc-middleware v1.2.2 h1:FlFbCRLd5Jr4iYXZufAvgWN6Ao0JrI5chLINnUXDDr0= github.com/grpc-ecosystem/go-grpc-middleware v1.2.2/go.mod h1:EaizFBKfUKtMIF5iaDEhniwNedqGo9FuLFzppDr3uwI= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=