Skip to content

feat(integration): make Go a full example-based variant#267

Open
sarahxsanders wants to merge 3 commits into
mainfrom
posthog-code/integration-go-framework
Open

feat(integration): make Go a full example-based variant#267
sarahxsanders wants to merge 3 commits into
mainfrom
posthog-code/integration-go-framework

Conversation

@sarahxsanders

@sarahxsanders sarahxsanders commented Jul 22, 2026

Copy link
Copy Markdown
Collaborator

Promotes the Go integration from a docs-only variant to a full example-based variant, anchored on a real, compiling example app at example-apps/go.

Why: without an anchoring example, the wizard reinvents the integration shape every run. A worked example collapses that variance — the point raised in review.

What's here:

  • example-apps/go/ — idiomatic net/http service: one client per process, env-var config, identify, event capture, feature flags via the current EvaluateFlags snapshot API, error tracking, and client.Close() on graceful shutdown. go build + go vet clean.
  • config.yaml: go switched from template: description-go-docs-only.mdexample_paths + framework: go.
  • Removed the now-unused description-go-docs-only.md.

Ships as a pair with the wizard detection PR PostHog/wizard#945.

@github-actions

Copy link
Copy Markdown

🧙 Wizard CI

Run the Wizard CI and test your changes against wizard-workbench example apps by replying with a GitHub comment using one of the following commands:

Test all apps:

  • /wizard-ci all

Test all apps in a directory:

  • /wizard-ci basic-integration
  • /wizard-ci mcp-analytics
  • /wizard-ci revenue

Test an individual app:

  • /wizard-ci basic-integration/android
  • /wizard-ci basic-integration/angular
  • /wizard-ci basic-integration/astro
Show more apps
  • /wizard-ci basic-integration/django
  • /wizard-ci basic-integration/fastapi
  • /wizard-ci basic-integration/flask
  • /wizard-ci basic-integration/javascript-node
  • /wizard-ci basic-integration/javascript-web
  • /wizard-ci basic-integration/laravel
  • /wizard-ci basic-integration/next-js
  • /wizard-ci basic-integration/nuxt
  • /wizard-ci basic-integration/python
  • /wizard-ci basic-integration/rails
  • /wizard-ci basic-integration/react-native
  • /wizard-ci basic-integration/react-router
  • /wizard-ci basic-integration/sveltekit
  • /wizard-ci basic-integration/swift
  • /wizard-ci basic-integration/tanstack-router
  • /wizard-ci basic-integration/tanstack-start
  • /wizard-ci basic-integration/vue
  • /wizard-ci mcp-analytics/custom-dispatcher
  • /wizard-ci mcp-analytics/typescript-sdk
  • /wizard-ci revenue/stripe

Results will be posted here when complete.

Replace the go docs-only variant with a full variant anchored on a real
example app (example-apps/go): an idiomatic net/http service that creates
one PostHog client per process, configures it from environment variables,
identifies users, captures events, evaluates feature flags via the current
EvaluateFlags snapshot API, reports errors, and flushes on graceful
shutdown with client.Close().

An anchoring example collapses the run-to-run variance a docs-only prompt
leaves open. Removes description-go-docs-only.md (now unused) and points
the variant at the example via example_paths + framework: go.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@sarahxsanders
sarahxsanders force-pushed the posthog-code/integration-go-framework branch from 18b4e97 to 6dabe99 Compare July 23, 2026 19:21
@sarahxsanders sarahxsanders changed the title feat(integration): route the go variant to wizard framework detection feat(integration): make Go a full example-based variant Jul 23, 2026
The handlers interpolated the cookie distinct id, the submitted user_id, the
email, and the error message straight into HTML. Since this example is copied
into real integrations, escape all user-controlled strings with
html.EscapeString so the pattern that gets propagated is safe by default.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@sarahxsanders
sarahxsanders marked this pull request as ready for review July 24, 2026 15:15
@sarahxsanders
sarahxsanders requested a review from a team as a code owner July 24, 2026 15:15
Semgrep (cookie-missing-httponly / cookie-missing-secure) blocks cookies
without these flags. Set HttpOnly, Secure, and SameSite=Lax on both the
user_id and burrito_count cookies so the copied pattern is secure by default.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant