Hello World
Hello World
Section titled “Hello World”The canonical entry point for any new go-zero developer.
Prerequisites
Section titled “Prerequisites”- Go 1.21+
- goctl installed
Generate
Section titled “Generate”goctl api new greetcd greetgo mod tidyProject Layout
Section titled “Project Layout”greet/├── etc/│ └── greet-api.yaml├── internal/│ ├── config/│ ├── handler/│ ├── logic/│ ├── svc/│ └── types/└── greet.gogo run greet.gocurl http://localhost:8888/from/you# {"message":"Hello you"}What’s Next
Section titled “What’s Next”- Add middleware for logging
- Connect a database