mirror of
https://github.com/hanzoai/insights.git
synced 2026-11-02 14:32:45 +00:00
Modules declare go 1.27.1 and the build images follow. go fix applied the modernizers, and the ptr helper went once new(expr) could say it; omitzero is not applied, since it changes what the JSON says. Co-authored-by: Hanzo Dev <[email protected]>
19 lines
373 B
Go
19 lines
373 B
Go
package events
|
|
|
|
import "sync/atomic"
|
|
|
|
func makeTestSub(id uint64, token string, opts ...func(*Subscription)) Subscription {
|
|
sub := Subscription{
|
|
SubID: id,
|
|
TeamId: 1,
|
|
Token: token,
|
|
EventChan: make(chan any, 100),
|
|
ShouldClose: &atomic.Bool{},
|
|
DroppedEvents: &atomic.Uint64{},
|
|
}
|
|
for _, o := range opts {
|
|
o(&sub)
|
|
}
|
|
return sub
|
|
}
|