You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(analytics): use official Mixpanel Go SDK and drop redundant interface test
Review feedback from @mabd-dev:
1. Swap `github.com/dukex/mixpanel` for the official
`github.com/mixpanel/mixpanel-go` SDK referenced in
https://docs.mixpanel.com/docs/tracking-methods/sdks/go.
The official SDK exposes `NewApiClient(token)` and
`Track(ctx, []*Event)` instead of the dukex SDK's
`New(token, "")` / `Track(distinctID, event, *Event)`.
MixpanelAnalytics now constructs events via
`client.NewEvent(event, distinctID, properties)` and calls
`client.Track(context.Background(), []*Event{ev})`. The Analytics
interface is unchanged, so no callers are affected.
Also dropped the trailing `var _ = context.Background` line - it
was a placeholder for the old SDK's missing context support; the
new SDK takes a real context.Context.
2. Remove `TestAnalytics_InterfaceIsSatisfied` from
analytics_test.go. The `var _ Analytics = ...` declarations at the
bottom of analytics.go already enforce this at compile time, so
the test adds no coverage.
Verified: go build ./..., go vet ./..., go test ./... all pass.
0 commit comments