this repo has no description

Initial commit: Go demo app with spindle workflows

nandi 23030d4b

+204
+46
.pi/superpowers-state.json
··· 1 + { 2 + "workflow": { 3 + "phases": { 4 + "brainstorm": "pending", 5 + "plan": "pending", 6 + "execute": "pending", 7 + "verify": "pending", 8 + "review": "pending", 9 + "finish": "pending" 10 + }, 11 + "currentPhase": null, 12 + "artifacts": { 13 + "brainstorm": null, 14 + "plan": null, 15 + "execute": null, 16 + "verify": null, 17 + "review": null, 18 + "finish": null 19 + }, 20 + "prompted": { 21 + "brainstorm": false, 22 + "plan": false, 23 + "execute": false, 24 + "verify": false, 25 + "review": false, 26 + "finish": false 27 + } 28 + }, 29 + "tdd": { 30 + "phase": "idle", 31 + "testFiles": [], 32 + "sourceFiles": [ 33 + "/home/nandi/code/godemo/main.go" 34 + ], 35 + "redVerificationPending": false 36 + }, 37 + "debug": { 38 + "active": false, 39 + "investigated": true, 40 + "fixAttempts": 0 41 + }, 42 + "verification": { 43 + "verified": false, 44 + "verificationWaived": false 45 + } 46 + }
+37
.tangled/workflows/build.yml
··· 1 + # .tangled/workflows/build.yml 2 + # Spindle workflow for building and testing the Go demo app 3 + 4 + when: 5 + - event: ["push", "manual"] 6 + branch: ["main"] 7 + - event: ["pull_request"] 8 + branch: ["main"] 9 + 10 + engine: "nixery" 11 + 12 + clone: 13 + skip: false 14 + depth: 1 15 + submodules: false 16 + 17 + dependencies: 18 + nixpkgs: 19 + - go 20 + 21 + environment: 22 + CGO_ENABLED: "0" 23 + GOOS: "linux" 24 + GOARCH: "amd64" 25 + 26 + steps: 27 + - name: "Download dependencies" 28 + command: "go mod download" 29 + 30 + - name: "Build" 31 + command: "go build -v -o godemo ." 32 + 33 + - name: "Test" 34 + command: "go test -v ./..." 35 + 36 + - name: "Show binary info" 37 + command: "ls -la godemo && file godemo"
+49
.tangled/workflows/release.yml
··· 1 + # .tangled/workflows/release.yml 2 + # Spindle workflow for creating releases 3 + 4 + when: 5 + - event: ["push"] 6 + tag: ["v*"] 7 + 8 + engine: "nixery" 9 + 10 + clone: 11 + skip: false 12 + depth: 1 13 + submodules: false 14 + 15 + dependencies: 16 + nixpkgs: 17 + - go 18 + - git 19 + 20 + environment: 21 + CGO_ENABLED: "0" 22 + 23 + steps: 24 + - name: "Download dependencies" 25 + command: "go mod download" 26 + 27 + - name: "Build for Linux amd64" 28 + command: | 29 + GOOS=linux GOARCH=amd64 go build -v -ldflags="-s -w" -o godemo-linux-amd64 . 30 + 31 + - name: "Build for Linux arm64" 32 + command: | 33 + GOOS=linux GOARCH=arm64 go build -v -ldflags="-s -w" -o godemo-linux-arm64 . 34 + 35 + - name: "Build for Darwin amd64" 36 + command: | 37 + GOOS=darwin GOARCH=amd64 go build -v -ldflags="-s -w" -o godemo-darwin-amd64 . 38 + 39 + - name: "Build for Darwin arm64" 40 + command: | 41 + GOOS=darwin GOARCH=arm64 go build -v -ldflags="-s -w" -o godemo-darwin-arm64 . 42 + 43 + - name: "List release artifacts" 44 + command: | 45 + echo "Release artifacts:" 46 + ls -la godemo-* 47 + echo "" 48 + echo "SHA256 checksums:" 49 + sha256sum godemo-*
+38
README.md
··· 1 + # Go Demo App 2 + 3 + A simple Go web server demo for Tangled. 4 + 5 + ## Running Locally 6 + 7 + ```bash 8 + go run main.go 9 + ``` 10 + 11 + The server will start on port 8080 by default. 12 + 13 + ## Endpoints 14 + 15 + - `/` - Returns a friendly greeting 16 + - `/health` - Health check endpoint 17 + 18 + ## Building 19 + 20 + ```bash 21 + go build -o godemo . 22 + ``` 23 + 24 + ## Spindle Pipelines 25 + 26 + This repository includes two spindle workflows: 27 + 28 + - **build.yml** - Runs on push to main and PRs. Builds and tests the app. 29 + - **release.yml** - Runs on version tags (v*). Builds release binaries for multiple platforms. 30 + 31 + ## Releasing 32 + 33 + To trigger a release, push a version tag: 34 + 35 + ```bash 36 + git tag v1.0.0 37 + git push origin v1.0.0 38 + ```
+3
go.mod
··· 1 + module godemo 2 + 3 + go 1.21
+31
main.go
··· 1 + package main 2 + 3 + import ( 4 + "fmt" 5 + "log" 6 + "net/http" 7 + "os" 8 + ) 9 + 10 + func main() { 11 + port := os.Getenv("PORT") 12 + if port == "" { 13 + port = "8080" 14 + } 15 + 16 + http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { 17 + fmt.Fprintf(w, "Hello from Tangled! 🌀\n") 18 + fmt.Fprintf(w, "This is a simple Go demo app.\n") 19 + }) 20 + 21 + http.HandleFunc("/health", func(w http.ResponseWriter, r *http.Request) { 22 + w.WriteHeader(http.StatusOK) 23 + fmt.Fprintf(w, "OK\n") 24 + }) 25 + 26 + addr := ":" + port 27 + log.Printf("Server starting on %s", addr) 28 + if err := http.ListenAndServe(addr, nil); err != nil { 29 + log.Fatalf("Server failed: %v", err) 30 + } 31 + }