diff options
author | René 'Necoro' Neumann <necoro@necoro.eu> | 2024-02-29 10:54:32 +0100 |
---|---|---|
committer | René 'Necoro' Neumann <necoro@necoro.eu> | 2024-02-29 10:54:32 +0100 |
commit | 503fa62794ccca8e27cde99f3fbabf41adad5f3f (patch) | |
tree | b5f33d4df92521ffc257668ecf31cbcb5ad35a22 /internal | |
parent | 0833f21bb79425d090fe9830bc6ea6fc9a065f4b (diff) | |
download | feed2imap-go-503fa62794ccca8e27cde99f3fbabf41adad5f3f.tar.gz feed2imap-go-503fa62794ccca8e27cde99f3fbabf41adad5f3f.tar.bz2 feed2imap-go-503fa62794ccca8e27cde99f3fbabf41adad5f3f.zip |
Replace util.Contains with slices.Contains
Diffstat (limited to '')
-rw-r--r-- | internal/feed/item.go | 4 | ||||
-rw-r--r-- | internal/imap/connection.go | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/internal/feed/item.go b/internal/feed/item.go index 79a971c..bc1865a 100644 --- a/internal/feed/item.go +++ b/internal/feed/item.go @@ -4,6 +4,7 @@ import ( "encoding/base64" "encoding/json" "fmt" + "slices" "strings" "time" @@ -11,7 +12,6 @@ import ( "github.com/google/uuid" "github.com/Necoro/feed2imap-go/pkg/config" - "github.com/Necoro/feed2imap-go/pkg/util" ) type feedImage struct { @@ -65,7 +65,7 @@ func (item *Item) FeedLink() string { } func (item *Item) AddReason(reason string) { - if !util.Contains(item.reasons, reason) { + if !slices.Contains(item.reasons, reason) { item.reasons = append(item.reasons, reason) } } diff --git a/internal/imap/connection.go b/internal/imap/connection.go index 8c0f59c..201ca7d 100644 --- a/internal/imap/connection.go +++ b/internal/imap/connection.go @@ -3,6 +3,7 @@ package imap import ( "errors" "fmt" + "slices" "strings" "time" @@ -11,7 +12,6 @@ import ( imapClient "github.com/emersion/go-imap/client" "github.com/Necoro/feed2imap-go/pkg/log" - "github.com/Necoro/feed2imap-go/pkg/util" ) type client struct { @@ -125,7 +125,7 @@ func (conn *connection) ensureFolder(folder Folder) error { } switch { - case found == 0 || (found == 1 && util.Contains(mbox.Attributes, imap.NoSelectAttr)): + case found == 0 || (found == 1 && slices.Contains(mbox.Attributes, imap.NoSelectAttr)): return conn.createFolder(folder.str) case found == 1: conn.mailboxes.add(mbox) |