Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions apps/error-tracking-upload-source-maps/go/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
bin/
.env
14 changes: 14 additions & 0 deletions apps/error-tracking-upload-source-maps/go/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
module example.com/go-app

go 1.22

require github.com/posthog/posthog-go v1.22.0

require (
github.com/andybalholm/brotli v1.1.1 // indirect
github.com/goccy/go-json v0.10.5 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect
github.com/klauspost/compress v1.17.11 // indirect
golang.org/x/sys v0.21.0 // indirect
)
26 changes: 26 additions & 0 deletions apps/error-tracking-upload-source-maps/go/go.sum
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
github.com/andybalholm/brotli v1.1.1 h1:PR2pgnyFznKEugtsUo0xLdDop5SKXd5Qf5ysW+7XdTA=
github.com/andybalholm/brotli v1.1.1/go.mod h1:05ib4cKhjx3OQYUY22hTVd34Bc8upXjOLL2rKwwZBoA=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/goccy/go-json v0.10.5 h1:Fq85nIqj+gXn/S5ahsiTlK3TmC85qgirsdTP/+DeaC4=
github.com/goccy/go-json v0.10.5/go.mod h1:oq7eo15ShAhp70Anwd5lgX2pLfOS3QCiwU/PULtXL6M=
github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=
github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU=
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/hashicorp/golang-lru/v2 v2.0.7 h1:a+bsQ5rvGLjzHuww6tVxozPZFVghXaHOwFs4luLUK2k=
github.com/hashicorp/golang-lru/v2 v2.0.7/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyfM2/ZepoAG6RGpeM=
github.com/klauspost/compress v1.17.11 h1:In6xLpyWOi1+C7tXUUWv2ot1QvBjxevKAaI6IXrJmUc=
github.com/klauspost/compress v1.17.11/go.mod h1:pMDklpSncoRMuLFrf1W9Ss9KT+0rH90U12bZKk7uwG0=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/posthog/posthog-go v1.22.0 h1:VNy+sMJ9MMnENr9dMSxfQt/5bB4UhwRdZfasOAghMMg=
github.com/posthog/posthog-go v1.22.0/go.mod h1://M430hNH3e8CDv4i8SJesb26816Mpa6GIZaiP4pNQU=
github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U=
github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U=
github.com/xyproto/randomstring v1.0.5 h1:YtlWPoRdgMu3NZtP45drfy1GKoojuR7hmRcnhZqKjWU=
github.com/xyproto/randomstring v1.0.5/go.mod h1:rgmS5DeNXLivK7YprL0pY+lTuhNQW3iGxZ18UQApw/E=
golang.org/x/sys v0.21.0 h1:rF+pYz3DAGSQAxAu1CbC7catZg4ebC4UIeIhKxBZvws=
golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
25 changes: 25 additions & 0 deletions apps/error-tracking-upload-source-maps/go/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package main

import (
"fmt"
"time"

"github.com/posthog/posthog-go"
)

func main() {
client, err := posthog.NewWithConfig(
"phc_raG2H9V246hkNZk6K89DZGG98qQyPrKKlicifGlpOXA",
posthog.Config{Endpoint: "https://internal-c.posthog.com"},
)
if err != nil {
panic(err)
}
defer client.Close()

_ = client.Enqueue(posthog.NewDefaultException(
time.Now(), "go-app-user", "ExampleError", "hello from go-app",
))

fmt.Println("Source Map Example (Go)")
}
5 changes: 3 additions & 2 deletions services/wizard-ci/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,8 @@ export function findApps(appsDir: string): App[] {
const isWizardRoot = existsSync(join(fullPath, ".wizard-root"));

// Check for JS/TS projects (package.json), Python projects (manage.py for Django, requirements.txt),
// Android projects (build.gradle or build.gradle.kts), Rust projects (Cargo.toml), or Swift/Xcode projects
// Android projects (build.gradle or build.gradle.kts), Go projects (go.mod), Rust projects (Cargo.toml), or Swift/Xcode projects
const isGoProject = existsSync(join(fullPath, "go.mod"));
const isJsProject = existsSync(join(fullPath, "package.json"));
const isDjangoProject = existsSync(join(fullPath, "manage.py"));
const isPythonProject = existsSync(join(fullPath, "requirements.txt")) || existsSync(join(fullPath, "pyproject.toml"));
Expand All @@ -121,7 +122,7 @@ export function findApps(appsDir: string): App[] {
const isSwiftProject = existsSync(join(fullPath, "Package.swift")) ||
readdirSync(fullPath).some(f => f.endsWith(".xcodeproj"));

if (isWizardRoot || isJsProject || isDjangoProject || isPythonProject || isAndroidProject || isRailsProject || isRustProject || isSwiftProject) {
if (isWizardRoot || isJsProject || isDjangoProject || isPythonProject || isAndroidProject || isRailsProject || isGoProject || isRustProject || isSwiftProject) {
apps.push({ name: relativePath, path: fullPath });
} else {
scan(fullPath, relativePath);
Expand Down