mirror of
https://github.com/docker/compose.git
synced 2026-08-03 22:27:30 +00:00
refactor: use slices.Contains to simplify code
Signed-off-by: tongjicoder <tongjicoder@icloud.com>
This commit is contained in:
parent
d49a68ecbf
commit
2e71440bee
14 changed files with 32 additions and 47 deletions
|
|
@ -20,12 +20,12 @@ import (
|
|||
"context"
|
||||
"fmt"
|
||||
"io"
|
||||
"slices"
|
||||
"strings"
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/docker/compose/v2/pkg/api"
|
||||
"github.com/docker/compose/v2/pkg/utils"
|
||||
|
||||
"github.com/buger/goterm"
|
||||
"github.com/docker/go-units"
|
||||
|
|
@ -77,7 +77,7 @@ func (w *ttyWriter) Event(e Event) {
|
|||
}
|
||||
|
||||
func (w *ttyWriter) event(e Event) {
|
||||
if !utils.StringContains(w.eventIDs, e.ID) {
|
||||
if !slices.Contains(w.eventIDs, e.ID) {
|
||||
w.eventIDs = append(w.eventIDs, e.ID)
|
||||
}
|
||||
if _, ok := w.events[e.ID]; ok {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue