Use go-zero when you want generated services
go-zero fits Go teams that want goctl to generate HTTP and RPC service layouts from interface definitions. Skip it if your team wants ordinary HTTP handlers without adopting those conventions. The official go-zero README describes generation from .api files, runtime controls and a directory layout that separates handlers, business logic and shared dependencies. That makes the generator part of the architectural choice, alongside the framework library.
RPC means remote procedure call: one service calls another over the network. The README's workflow starts with an interface definition, generates the service structure and then adds application logic. For a team evaluating go-zero, the useful question is whether those generated boundaries match how it reviews contracts, connects databases and maintains services. The documented service context provides a specific place to examine that fit because the README puts MySQL and Redis dependencies there.
What people use go-zero for
The project authors report a Java and MongoDB migration, while users describe serverless deployment, custom metrics and RPC discovery work. These accounts answer different adoption questions. The migration explains the project's origin; the integration reports show the adjustments individual users made. Each account below stays attached to its author and discussion rather than becoming a general claim about deployments running go-zero.
| Who used it | What they did | Reported outcome |
|---|---|---|
| Project authors | Replaced a Java and MongoDB monolith with Go microservices | They report deployment in August 2018 after almost half a year of work in the examples repository's migration account. |
| GitHub user jaronnie | Connected jzero-admin to Vercel through a replacement dependency | The initial deployment report was followed by a 404 regression and a custom Serve/BindRoutes workaround in serverless issue #4892. |
| GitHub user SaneHe | Added a custom metric in HTTP middleware | They confirmed local Prometheus agent collection, then reported missing custom metrics through their Pushgateway writer in metrics issue #1631. |
| GitHub user sjfxy | Reworked discovery and RPC client injection | They described Consul discovery, generated gRPC clients and a base client that resolves service names in RPC issue #939. |
For organization names, zhaoweiguo posted Lenovo in the project's adoption thread, issue #602. That is a participant's adoption report. The more detailed integration threads are better starting points for technical questions: they identify a hosting interface, collection route or connection-sharing requirement that another developer can compare with their own application. The Lenovo entry identifies the organization and links its homepage.
What happened when we ran it
Our October build succeeded in 132 seconds, and its test command exited 1 after 83 seconds. We measured these steps at commit 54e7a93 on October 24, 2026. The October harness result records installation in 51 seconds with 251 dependencies, followed by the successful build and failed test command. Its configured sandbox had 3 CPUs, 8 GB RAM and the image label golang:1.24-bookworm.
| October source-checkout step | Result |
|---|---|
| Install | Succeeded in 51 seconds; 251 dependencies recorded |
| Build | Succeeded in 132 seconds |
| Test command | Exit 1 after 83 seconds; summary counted 51 passing and 2 failing outcomes out of 53 |
The retained output contains successful zrpc package lines followed by the final FAIL in our October test tail. The summary counts are recorded outcomes, not an enumeration of 53 individual test cases. The repository scan also recorded 1,374 files, approximately 156,707 source lines, a 20.4 MB checkout, five CI workflow files, no Dockerfile and no directory named tests. Successful package lines appear in the same record, so the directory name is not a test inventory.
The November 27 quick-start run recorded checkout c669688265c5 and used a fresh unprivileged container with 2 CPUs, 4 GB RAM, no published ports and no secrets. Its recipe was quickstart-lib. The clone step took 2 seconds, and the library installation fetched v1.11.0 in 13.4 seconds through go get in a new module.
| November quick-start check | Recorded outcome |
|---|---|
| Scope | Checkout c669688265c5; module-proxy installation in a fresh unprivileged container |
| Clone | 2 seconds |
| Install | go-zero v1.11.0 in 13.4 seconds |
| Installed size | 588.9 MB in the module cache |
| Dependency count | 140 packages besides go-zero |
| First Quick Start Go block | Not a main package; could not run as written |
| Cleanup | Teardown completed successfully |
The November snippet step failed because the recipe selected the first Go-labelled Quick Start block. The README calls that block greet.api and uses it as input to goctl; the generated greet.go is the main file. This is a recipe-selection failure with a concrete explanation in the documentation. The recorded library installation and the failed snippet step are separate outcomes.
Where people get stuck: discovery, metrics and generated names
Issue #939 reports an RPC discovery timeout, #1631 separates two metric-delivery paths, and #947 describes generated request-name collisions. Their remedies address different boundaries. The discovery discussion begins with connectivity and service startup; the metrics discussion turns on how observations reach Prometheus; the naming discussion concerns the shape of generated types. Keeping those distinctions makes the issue tracker more useful than treating each closed thread as a delivered fix.
| Symptom and source | Advice or workaround in the discussion | Reported outcome |
|---|---|---|
| RPC timeout in issue #939 | Check etcd accessibility and RPC startup | The reporter later describes custom discovery and client injection |
| Missing custom metrics in issue #1631 | Distinguish local agent collection from the custom Pushgateway writer | Local collection works; the reporter says the writer misses custom metrics |
| Type-name collisions in issue #947 | Use names such as CreateUserRequest and CreateRoleRequest | The discussion records goctl 1.1.10 |
| goctl command not found in the installation guide | Add the Go binary installation directory to PATH | The guide gives the PATH correction |
| Profiling availability in issue #806 | Use the built-in core/prof package | The maintainer identifies the package |
In #939, the recorded error includes context deadline exceeded and names add.rpc. Maintainer kevwan advises checking that etcd is accessible and the RPC service has started. The later discussion concerns sharing a connection across clients, for which sjfxy describes a custom discovery and injection arrangement. In #1631, an early label-argument suggestion is retracted before SaneHe clarifies that local Prometheus agent collection works and the custom writer is the problematic route.
Large uploads expose a peak-memory question
Participants in issue #3564 report high memory use during multipart uploads and discuss request-body duplication in logging. The reporter used ParseMultipartForm and FormFile before writing received files locally. They also compared the behavior with a standalone net/http server in the upload-memory discussion. That comparison identifies a useful reproduction boundary: the upload body, handler and request-logging path.
The maintainer says memory is released after the request, while liang09255 argues that an instantaneous heap allocation comparable to the file size can still exhaust available memory. The maintainer agrees to investigate avoiding iox.DupReadCloser for large content lengths. Eventual release and excessive peak memory are different properties, so those comments can coexist. For an upload-heavy application, peak memory during concurrent transfers is the relevant acceptance question raised by the thread.
Security behavior changed in v1.11.0
Release v1.11.0 requires Go 1.25 or later and changes RPC authentication, CORS and JWT failure logging. Its release notes say RPC authentication rejects unknown applications and Redis lookup failures regardless of StrictControl, which is deprecated. They also describe preserving CORS origin restrictions when adding headers, replacing routers or serving files, and removing credential support for wildcard origins.
For credentialed browser requests, the release notes call for explicit trusted origins. They separately describe limiting request-body reads during JWT failure logging to prevent unbounded gzip decompression. These are distinct request paths and configuration concerns. An upgrade review should therefore keep the dependency version, trusted origins and RPC authentication expectations together. The JWT logging change does not describe the multipart-upload path discussed in issue #3564.
English documentation and community participation
The project has an English README and getting-started documentation, and issue #1071 records a request for English community communication. Maintainer kevwan acknowledges that some users could not participate because they did not understand Chinese in the language discussion. The thread includes translation bots and support for more English communication, giving an English-speaking newcomer a documented route into the project.
Some technical exchanges used in this review are Chinese, including generated model requests and parts of the RPC discussion. The Bilibili search results also list Chinese-language introductory material by 枫枫讲Go语言 and a practical-project title by 七米老师. These are language-specific learning leads. The English README remains the direct starting point for the generation sequence, directory structure and documented service commands.
go-zero vs Gin, Echo and Go Micro
Issue #4892's reporter cites Gin and Echo for ServeHTTP support when discussing Vercel integration. That makes them relevant to a hosting-interface decision. Separately, FAUN describes Go Micro through swappable service interfaces. These comparisons answer architectural questions: whether the application needs generated service conventions, an HTTP adapter boundary or replaceable service components. They do not require a speed ranking to help a reader choose an evaluation path.
| Candidate | Reason to consider it | Evidence |
|---|---|---|
| go-zero | You want generated HTTP and RPC service layouts | The goctl guide lists HTTP, RPC and model-generation commands |
| Gin | Your selection turns on a ServeHTTP-based adapter | jaronnie cites Gin in issue #4892 |
| Echo | You want another candidate for that HTTP adapter boundary | jaronnie also cites Echo in issue #4892 |
| Go Micro | You want swappable discovery, transport and broker implementations | FAUN describes Go Micro's interfaces |
| Standard library net/http | You need a baseline for the reported upload behavior | The upload reporter compares net/http in issue #3564 |
The serverless chronology is particularly useful. jaronnie first reports a branch-based deployment, then a 404 after an update. They later describe custom Serve and BindRoutes methods working with jzero-admin. The readable issue #4892 timeline records closure through PR #5001 on July 12, 2025. That sequence is more informative than presenting the first deployment link as the final state of the integration.
What the docs get wrong
The getting-started page's instruction to edit only internal/logic conflicts with the README's dependency-wiring instructions. The getting-started page says everything else is regenerated from the .api file, while the official README tells developers to pass dependencies through servicecontext.go. Business logic and service wiring are therefore separate editing responsibilities in the documented workflow.
The examples repository gives go get as its goctl installation command, whereas the dedicated goctl installation guide uses go install github.com/zeromicro/go-zero/tools/goctl@latest. Installing that executable is separate from adding the framework library to an application. There is also a toolchain mismatch: the getting-started page lists Go 1.21, while v1.11.0 requires Go 1.25 or later. Choose the framework version before following a tutorial's minimum requirement.
FAQ
go-zero is a Go web and RPC framework with the goctl code generator, according to its official README. The repository is zeromicro/go-zero; zero-examples is the separate examples repository. The questions below follow repository searches, learning queries and issue discussions, with answers tied to those records. They focus on the first decisions a developer faces: the workflow, tooling, generated methods and deployment interface.
What is go-zero, and what does it provide for Go services?
go-zero combines HTTP and RPC development with code generation and documented runtime controls, including timeouts and rate limiting. The README's Quick Start starts with greet.api, generates Go server code and identifies greet.go as the main file. The practical adoption decision includes those interface definitions and generated directories, rather than only the library import. Database and cache dependencies enter through the service context.
How do I learn the basics of the go-zero microservices framework?
The getting-started sequence introduces Go, goctl, API description syntax and Hello World before the full API and RPC guides. It lists protoc 3.x for RPC services only. For v1.11.0, use the release's Go 1.25-or-later requirement. The installation guide then gives separate generation commands for a new HTTP service, a new RPC service and code from existing interface definitions.
Which companies and organizations report using go-zero?
GitHub participant zhaoweiguo posts Lenovo in the adoption thread, issue #602. The entry names the organization and gives its homepage. For a technical reference conversation, the service's deployment method, dependency versions and integration requirements would be more useful than the organization name alone. The migration and serverless accounts elsewhere in this review contain more detail about what their authors actually built.
Can goctl generate pagination and bulk-import methods for database models?
Issue #548 requests pagination and bulk-import methods, with additional requests for batch-ID lookup and filtered pagination. Contributor kesonan discusses exposing template parameters so developers can customize generation. The thread is a feature-request and template-design discussion. For an application with those queries, the concrete evaluation task is to generate models for its schema and list the methods the resulting data layer contains.
Why was ServeHTTP removed in v1.8.1, and how can I deploy go-zero on Vercel serverless?
Maintainer kevwan says the earlier implementation bound routes on every request and caused a memory leak in issue #4892. jaronnie reports a replacement dependency, a later regression and a custom Serve/BindRoutes workaround. The thread then closes through serverless PR #5001. Its sequence identifies the handler entry point and route binding as the integration details an application must exercise.
Why does my go-zero RPC client time out when connecting through local etcd?
Maintainer kevwan advises checking etcd accessibility and RPC startup in issue #939. The reported error includes context deadline exceeded and names add.rpc. The same discussion later addresses sharing connections across RPC clients, where sjfxy describes custom discovery and injection. Those are separate stages of troubleshooting: first establish discovery connectivity and service startup, then examine the application's client-sharing arrangement.
What we have not tested yet
Our runs cover repository commands, module installation and a failed snippet selection, rather than a deployed HTTP or RPC workload. Production traffic, latency, throughput, sustained memory, service recovery, generated clients and upgrade compatibility remain outside those measurements. The October tail cannot identify or diagnose the summarized failures. The image labels do not establish the actual compiler or operating-system versions, and the November checkout identifier is separate from the module-proxy installation of v1.11.0.
The serverless discussion does not identify the first compatible released version, the upload discussion does not demonstrate a completed bounded-memory remedy, and SaneHe's final clarification reports no successful custom-writer delivery to Pushgateway. The historical naming workaround concerns goctl 1.1.10. Exact overwrite behavior across generated file types, pagination and bulk-operation templates, and the disputed MongoDB cache keys in issue #2279 also need application-specific execution.
The adoption entries provide no independent workload, operating-cost or reliability measurements. The video records provide no usable YouTube transcripts, and this review attributes no demonstrated task to those creators. OpenAPI conversion with real schemas, comparative workloads and security assessment are also outside the recorded work. Rendered layout, resolved links, related links, recommendation modules and template content have not been exercised here. The next practical step is one generated service using the application's actual contract, dependencies and hosting entry point.


