PostHog / posthog-go

Official PostHog Go library
MIT License
20 stars 17 forks source link

Initialize properties map when sending feature flags #26

Closed zaynetro closed 6 months ago

zaynetro commented 7 months ago

When capturing an event with SendFeatureFlags set to true and no properties defined posthog panics with nil pointer.

Panic:

github.com/posthog/posthog-go.(*client).Enqueue(0x4000abba00, {0x420b130?, 0x40015705a0?)

  /root/go/pkg/mod/github.com/posthog/posthog-go@v0.0.0-20240110105835-f2ee529330e9/posthog.go:194

Example:

client.Enqueue(posthog.Capture{
    DistinctId: user.ID,
    Event:      "test_event",
    SendFeatureFlags: true,
})
neilkakkar commented 6 months ago

lovely, thanks!