Skip to content

Commit 7466f40

Browse files
committed
feat: real Go fixture for the upload-source-maps workflow
1 parent 47d0d9b commit 7466f40

5 files changed

Lines changed: 70 additions & 2 deletions

File tree

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
bin/
2+
.env
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
module example.com/go-app
2+
3+
go 1.22
4+
5+
require github.com/posthog/posthog-go v1.22.0
6+
7+
require (
8+
github.com/andybalholm/brotli v1.1.1 // indirect
9+
github.com/goccy/go-json v0.10.5 // indirect
10+
github.com/google/uuid v1.6.0 // indirect
11+
github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect
12+
github.com/klauspost/compress v1.17.11 // indirect
13+
golang.org/x/sys v0.21.0 // indirect
14+
)
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
github.com/andybalholm/brotli v1.1.1 h1:PR2pgnyFznKEugtsUo0xLdDop5SKXd5Qf5ysW+7XdTA=
2+
github.com/andybalholm/brotli v1.1.1/go.mod h1:05ib4cKhjx3OQYUY22hTVd34Bc8upXjOLL2rKwwZBoA=
3+
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
4+
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
5+
github.com/goccy/go-json v0.10.5 h1:Fq85nIqj+gXn/S5ahsiTlK3TmC85qgirsdTP/+DeaC4=
6+
github.com/goccy/go-json v0.10.5/go.mod h1:oq7eo15ShAhp70Anwd5lgX2pLfOS3QCiwU/PULtXL6M=
7+
github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=
8+
github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU=
9+
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
10+
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
11+
github.com/hashicorp/golang-lru/v2 v2.0.7 h1:a+bsQ5rvGLjzHuww6tVxozPZFVghXaHOwFs4luLUK2k=
12+
github.com/hashicorp/golang-lru/v2 v2.0.7/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyfM2/ZepoAG6RGpeM=
13+
github.com/klauspost/compress v1.17.11 h1:In6xLpyWOi1+C7tXUUWv2ot1QvBjxevKAaI6IXrJmUc=
14+
github.com/klauspost/compress v1.17.11/go.mod h1:pMDklpSncoRMuLFrf1W9Ss9KT+0rH90U12bZKk7uwG0=
15+
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
16+
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
17+
github.com/posthog/posthog-go v1.22.0 h1:VNy+sMJ9MMnENr9dMSxfQt/5bB4UhwRdZfasOAghMMg=
18+
github.com/posthog/posthog-go v1.22.0/go.mod h1://M430hNH3e8CDv4i8SJesb26816Mpa6GIZaiP4pNQU=
19+
github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U=
20+
github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U=
21+
github.com/xyproto/randomstring v1.0.5 h1:YtlWPoRdgMu3NZtP45drfy1GKoojuR7hmRcnhZqKjWU=
22+
github.com/xyproto/randomstring v1.0.5/go.mod h1:rgmS5DeNXLivK7YprL0pY+lTuhNQW3iGxZ18UQApw/E=
23+
golang.org/x/sys v0.21.0 h1:rF+pYz3DAGSQAxAu1CbC7catZg4ebC4UIeIhKxBZvws=
24+
golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
25+
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
26+
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
package main
2+
3+
import (
4+
"fmt"
5+
"time"
6+
7+
"github.com/posthog/posthog-go"
8+
)
9+
10+
func main() {
11+
client, err := posthog.NewWithConfig(
12+
"phc_raG2H9V246hkNZk6K89DZGG98qQyPrKKlicifGlpOXA",
13+
posthog.Config{Endpoint: "https://internal-c.posthog.com"},
14+
)
15+
if err != nil {
16+
panic(err)
17+
}
18+
defer client.Close()
19+
20+
_ = client.Enqueue(posthog.NewDefaultException(
21+
time.Now(), "go-app-user", "ExampleError", "hello from go-app",
22+
))
23+
24+
fmt.Println("Source Map Example (Go)")
25+
}

services/wizard-ci/utils.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,8 @@ export function findApps(appsDir: string): App[] {
111111
const isWizardRoot = existsSync(join(fullPath, ".wizard-root"));
112112

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

124-
if (isWizardRoot || isJsProject || isDjangoProject || isPythonProject || isAndroidProject || isRailsProject || isRustProject || isSwiftProject) {
125+
if (isWizardRoot || isJsProject || isDjangoProject || isPythonProject || isAndroidProject || isRailsProject || isGoProject || isRustProject || isSwiftProject) {
125126
apps.push({ name: relativePath, path: fullPath });
126127
} else {
127128
scan(fullPath, relativePath);

0 commit comments

Comments
 (0)