Skip to main content

Noop Provider

The noop provider silently discards all events. It is useful as a default provider during development or testing when you don't want real data sent to an analytics service.

The noop provider is currently available for Go only. For Kotlin, use an inline object:

Usage

import "github.com/dejanradmanovic/event-spec/provider/noop"

client := analytics.NewClient(
analytics.WithProviders(noop.New()),
)

Use cases

  • Development — prevent local development events from polluting production analytics
  • Tests — when you only care about hook behavior, not provider delivery
  • Feature flags — use the noop provider as a fallback when analytics is disabled at runtime

Comparison with testutil providers

ProviderRecords eventsPurpose
noop.New()NoSilent discard; default / dev placeholder
testutil.NewCaptureProvider()YesTest assertions — verify what was sent
testutil.NewMockProvider()NoSimulate latency / errors in tests

Use noop when you want nothing to happen. Use CaptureProvider when you want to assert what would have happened.