Skip to content

[go] zero-config/services support for Go#14865

Merged
ricardo-agz merged 24 commits intomainfrom
cursor/go-runtime-framework-design-5b77
Feb 5, 2026
Merged

[go] zero-config/services support for Go#14865
ricardo-agz merged 24 commits intomainfrom
cursor/go-runtime-framework-design-5b77

Conversation

@ricardo-agz
Copy link
Copy Markdown
Contributor

@ricardo-agz ricardo-agz commented Feb 4, 2026

  • Adds a new framework runtime preset for Go (feature flagged)
  • Adds support for running zero-config Go with the "executable" runtime (mirroring what we do for Rust) when the framework is set to "go" or "services". This creates a standalone server bootstrapped with new vc-init.go instead of the previous go-bridge
  • Adds an example for Gin with the "executable" runtime

https://vercel-plus-gin.vercel.app/

This document outlines the design for adding Go as an experimental
'runtime' framework preset, analyzing:

- How existing runtime presets (Python, Ruby, Rust, Node) work
- Detection logic for Go projects (go.mod + main.go)
- Entrypoint conventions and why main.go is most idiomatic
- Required changes to @vercel/go package for standalone server support
- Implementation plan with code examples

Co-authored-by: Ricardo Gonzalez <ricardo-agz@users.noreply.github.com>
@cursor
Copy link
Copy Markdown

cursor bot commented Feb 4, 2026

Cursor Agent can help with this pull request. Just @cursor in comments and I'll start working on changes in this branch.
Learn more about Cursor Agents

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Feb 4, 2026

🦋 Changeset detected

Latest commit: 6928c56

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 4 packages
Name Type
@vercel/go Minor
@vercel/frameworks Minor
vercel Patch
@vercel/fs-detectors Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Feb 4, 2026

📦 CLI Tarball Ready

The Vercel CLI tarball for this PR is now available!

Quick Test

You can test this PR's CLI directly by running:

npx https://vercel-4ot0fsi26.vercel.sh/tarballs/vercel.tgz --help

Use in vercel.json

To use this CLI version in your project builds, add to your vercel.json:

{
  "build": {
    "env": {
      "VERCEL_CLI_VERSION": "vercel@https://vercel-4ot0fsi26.vercel.sh/tarballs/vercel.tgz"
    }
  }
}

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Feb 4, 2026

🧪 Unit Test Strategy

Comparing: d564b3c6928c56 (view diff)

Strategy: Affected packages only

✅ Only testing packages that have been modified or depend on modified packages.

Affected packages - 6 (15%)
  1. @vercel/frameworks
  2. @vercel/fs-detectors
  3. @vercel/go
  4. @vercel/static-build
  5. examples
  6. vercel
Unaffected packages - 34 (85%)
  1. @vercel-internals/get-package-json
  2. @vercel/backends
  3. @vercel/build-utils
  4. @vercel/cervel
  5. @vercel/cli-auth
  6. @vercel/client
  7. @vercel/config
  8. @vercel/detect-agent
  9. @vercel/edge
  10. @vercel/elysia
  11. @vercel/error-utils
  12. @vercel/express
  13. @vercel/fastify
  14. @vercel/firewall
  15. @vercel/functions
  16. @vercel/gatsby-plugin-vercel-builder
  17. @vercel/h3
  18. @vercel/hono
  19. @vercel/hydrogen
  20. @vercel/koa
  21. @vercel/nestjs
  22. @vercel/next
  23. @vercel/node
  24. @vercel/oidc
  25. @vercel/oidc-aws-credentials-provider
  26. @vercel/python
  27. @vercel/python-analysis
  28. @vercel/redwood
  29. @vercel/related-projects
  30. @vercel/remix-builder
  31. @vercel/routing-utils
  32. @vercel/ruby
  33. @vercel/rust
  34. @vercel/static-config

Results

  • Unit tests: Only affected packages will run unit tests
  • E2E tests: Handled separately (Version Packages PRs or run-e2e-tests label)
  • Type checks: Only affected packages will run type checks

This comment is automatically generated based on the affected testing strategy

cursoragent and others added 2 commits February 4, 2026 23:35
Co-authored-by: Ricardo Gonzalez <ricardo-agz@users.noreply.github.com>
Co-authored-by: Ricardo Gonzalez <ricardo-agz@users.noreply.github.com>
@ricardo-agz ricardo-agz changed the title Go runtime framework design [go] experimental runtime preset (draft) Feb 4, 2026
- Add support for both simple (main.go) and standard layout (cmd/*/main.go)
- Define entrypoint resolution priority: main.go > cmd/api > cmd/server > cmd/web > cmd/app > fallback
- Update build and dev server implementations to handle cmd/ pattern
- Add real-world examples (go-gin-starter, rest-in-go)
- Prioritize cmd/api/main.go as most relevant for Vercel use case

Co-authored-by: Ricardo Gonzalez <ricardo-agz@users.noreply.github.com>
Support only:
- main.go (simple projects)
- cmd/api/main.go (API servers)
- cmd/server/main.go (HTTP servers)

This covers the majority of Go web applications while keeping
the implementation simple and predictable. Additional paths
can be added based on user feedback.

Co-authored-by: Ricardo Gonzalez <ricardo-agz@users.noreply.github.com>
Add support for deploying standalone Go HTTP servers as an experimental
runtime framework preset, similar to Python, Ruby, Rust, and Node.

Changes:
- Add Go framework preset to @vercel/frameworks with detection for:
  - main.go (simple projects)
  - cmd/api/main.go (API servers)
  - cmd/server/main.go (HTTP servers)

- Modify @vercel/go to support standalone server mode:
  - Add entrypoint resolution for supported paths
  - Add standalone server detection (package main + func main)
  - Implement buildStandaloneServer using 'provided.al2' runtime
  - Add startStandaloneDevServer for vercel dev support

The Go application must listen on the PORT environment variable.
- Fix BuildOptions type error by accepting full options object
- Use let instead of const for entrypoint to allow reassignment
- Add Go logo SVG to packages/frameworks/logos/
- Changed from 'provided.al2' to 'executable' runtime
- Binary and handler renamed from 'bootstrap' to 'executable'
- Added 'architecture: x86_64' and 'runtimeLanguage: go'
- This matches the approach used by @vercel/rust for standalone servers
…tion

- Updated code examples to use 'executable' binary naming (like Rust)
- Marked dev server support as future enhancement
- Updated status of implemented features
@ricardo-agz ricardo-agz marked this pull request as ready for review February 5, 2026 04:05
@ricardo-agz ricardo-agz requested review from a team, agadzik and chloetedder as code owners February 5, 2026 04:05
@ricardo-agz ricardo-agz requested review from ecklf and gscho February 5, 2026 04:06
@ricardo-agz ricardo-agz changed the title [go] services support for Go [go] zero-config/services support for Go Feb 5, 2026
@ricardo-agz ricardo-agz merged commit 84f1211 into main Feb 5, 2026
249 of 252 checks passed
@ricardo-agz ricardo-agz deleted the cursor/go-runtime-framework-design-5b77 branch February 5, 2026 21:09
jeffsee55 pushed a commit that referenced this pull request Feb 6, 2026
This PR was opened by the [Changesets
release](https://github.com/changesets/action) GitHub action. When
you're ready to do a release, you can merge this and the packages will
be published to npm automatically. If you're not ready to do a release
yet, that's fine, whenever you add more changesets to main, this PR will
be updated.


# Releases
## @vercel/frameworks@3.17.0

### Minor Changes

- Add experimental Go runtime framework preset.
([#14865](#14865))

This adds support for deploying standalone Go HTTP servers (using
`package main` with `func main()`) in addition to the existing
serverless function pattern. The preset supports:

    -   `main.go` at project root (simple projects)
    -   `cmd/api/main.go` (API servers)
    -   `cmd/server/main.go` (HTTP servers)

The Go application must listen on the port specified by the `PORT`
environment variable.

## @vercel/go@3.4.0

### Minor Changes

- Add experimental Go runtime framework preset.
([#14865](#14865))

This adds support for deploying standalone Go HTTP servers (using
`package main` with `func main()`) in addition to the existing
serverless function pattern. The preset supports:

    -   `main.go` at project root (simple projects)
    -   `cmd/api/main.go` (API servers)
    -   `cmd/server/main.go` (HTTP servers)

The Go application must listen on the port specified by the `PORT`
environment variable.

## @vercel/backends@0.0.29

### Patch Changes

- Updated dependencies
\[[`fc357e11cb4b00ab8ec413a0ea3586a87e733f0e`](fc357e1),
[`ff320caa5c8a0857aad0b989699207a6a703256f`](ff320ca)]:
    -   @vercel/build-utils@13.3.2

## @vercel/build-utils@13.3.2

### Patch Changes

- Improve memory efficiency in `FileBlob.fromStream()` by avoiding
unnecessary buffer copies when chunks are already Buffers
([#14701](#14701))

- [services] build time service url env vars
([#14893](#14893))

- Updated dependencies
\[[`7a747344dfb778a650da2ee5f7fba8c974098b42`](7a74734)]:
    -   @vercel/python-analysis@0.3.1

## @vercel/cervel@0.0.16

### Patch Changes

-   Updated dependencies \[]:
    -   @vercel/backends@0.0.29

## vercel@50.12.2

### Patch Changes

- Add source and defaultResourceName query params to legacy integration
add web UI path ([#14868](#14868))

- [services] build time service url env vars
([#14893](#14893))

- Updated dependencies
\[[`fc357e11cb4b00ab8ec413a0ea3586a87e733f0e`](fc357e1),
[`84f121190813b2840a6a16279dcaa75dcb2872cd`](84f1211),
[`ff320caa5c8a0857aad0b989699207a6a703256f`](ff320ca)]:
    -   @vercel/build-utils@13.3.2
    -   @vercel/go@3.4.0
    -   @vercel/backends@0.0.29
    -   @vercel/elysia@0.1.31
    -   @vercel/express@0.1.40
    -   @vercel/fastify@0.1.34
    -   @vercel/h3@0.1.40
    -   @vercel/hono@0.2.34
    -   @vercel/hydrogen@1.3.5
    -   @vercel/koa@0.1.14
    -   @vercel/nestjs@0.2.35
    -   @vercel/next@4.15.23
    -   @vercel/node@5.5.32
    -   @vercel/python@6.6.0
    -   @vercel/redwood@2.4.9
    -   @vercel/remix-builder@5.5.10
    -   @vercel/ruby@2.2.5
    -   @vercel/rust@1.0.5
    -   @vercel/static-build@2.8.33

## @vercel/client@17.2.35

### Patch Changes

- Updated dependencies
\[[`fc357e11cb4b00ab8ec413a0ea3586a87e733f0e`](fc357e1),
[`ff320caa5c8a0857aad0b989699207a6a703256f`](ff320ca)]:
    -   @vercel/build-utils@13.3.2

## @vercel/elysia@0.1.31

### Patch Changes

-   Updated dependencies \[]:
    -   @vercel/node@5.5.32

## @vercel/express@0.1.40

### Patch Changes

-   Updated dependencies \[]:
    -   @vercel/node@5.5.32
    -   @vercel/cervel@0.0.16

## @vercel/fastify@0.1.34

### Patch Changes

-   Updated dependencies \[]:
    -   @vercel/node@5.5.32

## @vercel/fs-detectors@5.8.2

### Patch Changes

- Updated dependencies
\[[`84f121190813b2840a6a16279dcaa75dcb2872cd`](84f1211)]:
    -   @vercel/frameworks@3.17.0

## @vercel/gatsby-plugin-vercel-builder@2.0.131

### Patch Changes

- Updated dependencies
\[[`fc357e11cb4b00ab8ec413a0ea3586a87e733f0e`](fc357e1),
[`ff320caa5c8a0857aad0b989699207a6a703256f`](ff320ca)]:
    -   @vercel/build-utils@13.3.2

## @vercel/h3@0.1.40

### Patch Changes

-   Updated dependencies \[]:
    -   @vercel/node@5.5.32

## @vercel/hono@0.2.34

### Patch Changes

-   Updated dependencies \[]:
    -   @vercel/node@5.5.32

## @vercel/koa@0.1.14

### Patch Changes

-   Updated dependencies \[]:
    -   @vercel/node@5.5.32

## @vercel/nestjs@0.2.35

### Patch Changes

-   Updated dependencies \[]:
    -   @vercel/node@5.5.32

## @vercel/node@5.5.32

### Patch Changes

- Updated dependencies
\[[`fc357e11cb4b00ab8ec413a0ea3586a87e733f0e`](fc357e1),
[`ff320caa5c8a0857aad0b989699207a6a703256f`](ff320ca)]:
    -   @vercel/build-utils@13.3.2

## @vercel/python-analysis@0.3.1

### Patch Changes

- fix ESM/CJS cross-compatibility
([#14869](#14869))

## @vercel/static-build@2.8.33

### Patch Changes

-   Updated dependencies \[]:
    -   @vercel/gatsby-plugin-vercel-builder@2.0.131

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.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.

3 participants