MCPcopy Create free account
hub / github.com/auth0/auth0-cli / dedupeLogs

Function dedupeLogs

internal/cli/logs.go:253–269  ·  view source on GitHub ↗
(list []*management.Log, set map[string]struct{})

Source from the content-addressed store, hash-verified

251}
252
253func dedupeLogs(list []*management.Log, set map[string]struct{}) []*management.Log {
254 res := make([]*management.Log, 0, len(list))
255
256 for _, l := range list {
257 if _, ok := set[l.GetID()]; !ok {
258 // It's not a duplicate, track it, and take it.
259 set[l.GetID()] = struct{}{}
260 res = append(res, l)
261 }
262 }
263
264 sort.Slice(res, func(i, j int) bool {
265 return res[i].GetDate().Before(res[j].GetDate())
266 })
267
268 return res
269}

Callers 2

tailLogsCmdFunction · 0.85
TestDedupeLogsFunction · 0.85

Calls

no outgoing calls

Tested by 1

TestDedupeLogsFunction · 0.68