Skip to content

Commit 8d4dcfb

Browse files
committed
Merge branch 'master' into dependabot/go_modules/github.com/mattermost/mattermost/server/public-0.1.9
2 parents 093f8a4 + 8571cb2 commit 8d4dcfb

File tree

5 files changed

+11
-22
lines changed

5 files changed

+11
-22
lines changed

build/pluginctl/logs_test.go

+7-7
Original file line numberDiff line numberDiff line change
@@ -154,17 +154,17 @@ func TestFilterLogEntries(t *testing.T) {
154154
},
155155
"filter out old entries": {
156156
logs: []string{
157-
fmt.Sprintf(`{"message":"old2", "plugin_id": "some.plugin.id", "timestamp": "%s"}`, time.Now().Add(-2*time.Second).Format(timeStampFormat)),
158-
fmt.Sprintf(`{"message":"old1", "plugin_id": "some.plugin.id", "timestamp": "%s"}`, time.Now().Add(-1*time.Second).Format(timeStampFormat)),
159-
fmt.Sprintf(`{"message":"now", "plugin_id": "some.plugin.id", "timestamp": "%s"}`, time.Now().Format(timeStampFormat)),
160-
fmt.Sprintf(`{"message":"new1", "plugin_id": "some.plugin.id", "timestamp": "%s"}`, time.Now().Add(1*time.Second).Format(timeStampFormat)),
161-
fmt.Sprintf(`{"message":"new2", "plugin_id": "some.plugin.id", "timestamp": "%s"}`, time.Now().Add(2*time.Second).Format(timeStampFormat)),
157+
fmt.Sprintf(`{"message":"old2", "plugin_id": "some.plugin.id", "timestamp": "%s"}`, now.Add(-2*time.Second).Format(timeStampFormat)),
158+
fmt.Sprintf(`{"message":"old1", "plugin_id": "some.plugin.id", "timestamp": "%s"}`, now.Add(-1*time.Second).Format(timeStampFormat)),
159+
fmt.Sprintf(`{"message":"now", "plugin_id": "some.plugin.id", "timestamp": "%s"}`, now.Format(timeStampFormat)),
160+
fmt.Sprintf(`{"message":"new1", "plugin_id": "some.plugin.id", "timestamp": "%s"}`, now.Add(1*time.Second).Format(timeStampFormat)),
161+
fmt.Sprintf(`{"message":"new2", "plugin_id": "some.plugin.id", "timestamp": "%s"}`, now.Add(2*time.Second).Format(timeStampFormat)),
162162
},
163163
pluginID: "some.plugin.id",
164164
since: now,
165165
expectedLogs: []string{
166-
fmt.Sprintf(`{"message":"new1", "plugin_id": "some.plugin.id", "timestamp": "%s"}`, time.Now().Add(1*time.Second).Format(timeStampFormat)),
167-
fmt.Sprintf(`{"message":"new2", "plugin_id": "some.plugin.id", "timestamp": "%s"}`, time.Now().Add(2*time.Second).Format(timeStampFormat)),
166+
fmt.Sprintf(`{"message":"new1", "plugin_id": "some.plugin.id", "timestamp": "%s"}`, now.Add(1*time.Second).Format(timeStampFormat)),
167+
fmt.Sprintf(`{"message":"new2", "plugin_id": "some.plugin.id", "timestamp": "%s"}`, now.Add(2*time.Second).Format(timeStampFormat)),
168168
},
169169
expectedErr: false,
170170
},

go.mod

-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ require (
1010
github.com/mattermost/mattermost/server/public v0.1.9
1111
github.com/pkg/errors v0.9.1
1212
github.com/stretchr/testify v1.10.0
13-
github.com/thoas/go-funk v0.6.0
1413
go.uber.org/atomic v1.11.0
1514
)
1615

go.sum

-3
Original file line numberDiff line numberDiff line change
@@ -179,15 +179,12 @@ github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+
179179
github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY=
180180
github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA=
181181
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
182-
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
183182
github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
184183
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
185184
github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1FQKckRals=
186185
github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA=
187186
github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
188187
github.com/tarm/serial v0.0.0-20180830185346-98f6abe2eb07/go.mod h1:kDXzergiv9cbyO7IOYJZWg1U88JhDg3PB6klq9Hg2pA=
189-
github.com/thoas/go-funk v0.6.0 h1:ryxN0pa9FnI7YHgODdLIZ4T6paCZJt8od6N9oRztMxM=
190-
github.com/thoas/go-funk v0.6.0/go.mod h1:+IWnUfUmFO1+WVYQWQtIJHeRRdaIyyYglZN7xzUPe4Q=
191188
github.com/tinylib/msgp v1.2.0 h1:0uKB/662twsVBpYUPbokj4sTSKhWFKB7LopO2kWK8lY=
192189
github.com/tinylib/msgp v1.2.0/go.mod h1:2vIGs3lcUo8izAATNobrCHevYZC/LMsJtw4JPiYPHro=
193190
github.com/viant/assertly v0.4.8/go.mod h1:aGifi++jvCrUaklKEKT0BU95igDNaqkvz+49uaYMPRU=

server/service/notification.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package service
22

33
import (
4-
"github.com/thoas/go-funk"
4+
"slices"
55

66
"github.com/mattermost/mattermost-plugin-confluence/server/config"
77
"github.com/mattermost/mattermost-plugin-confluence/server/serializer"
@@ -41,12 +41,12 @@ func getNotificationChannelIDs(url, spaceKey, pageID, eventType string) []string
4141
urlSpaceKeySubscriptionChannelIDs := make([]string, 0)
4242
urlPageIDSubscriptionChannelIDs := make([]string, 0)
4343
for channelID, events := range urlPageIDSubscriptions {
44-
if funk.Contains(events, eventType) {
44+
if slices.Contains(events, eventType) {
4545
urlPageIDSubscriptionChannelIDs = append(urlPageIDSubscriptionChannelIDs, channelID)
4646
}
4747
}
4848
for channelID, events := range urlSpaceKeySubscriptions {
49-
if funk.Contains(events, eventType) {
49+
if slices.Contains(events, eventType) {
5050
urlSpaceKeySubscriptionChannelIDs = append(urlSpaceKeySubscriptionChannelIDs, channelID)
5151
}
5252
}

server/util/util.go

+1-8
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,6 @@ func GetKeyHash(key string) string {
2020
return base64.StdEncoding.EncodeToString(hash.Sum(nil))
2121
}
2222

23-
func Min(a, b int) int {
24-
if a < b {
25-
return a
26-
}
27-
return b
28-
}
29-
3023
func SplitArgs(s string) ([]string, error) {
3124
indexes := regexp.MustCompile("\"").FindAllStringIndex(s, -1)
3225
if len(indexes)%2 != 0 {
@@ -42,7 +35,7 @@ func SplitArgs(s string) ([]string, error) {
4235
var args []string
4336
for i := 0; i < len(indexes)-1; i++ {
4437
start := indexes[i][1]
45-
end := Min(len(s), indexes[i+1][0])
38+
end := min(len(s), indexes[i+1][0])
4639

4740
if i%2 == 0 {
4841
args = append(args, strings.Split(strings.Trim(s[start:end], " "), " ")...)

0 commit comments

Comments
 (0)