-
- Notifications
You must be signed in to change notification settings - Fork 4.3k
Open
Description
Describe the bug
跟着文档操作,执行命令goctl api go -api user.api -dir .报错:user.api 30:5 syntax error: expected '@handler' | '}', got '@server'
To Reproduce
goctl api go -api user.api -dir .
- The code is
syntax = "v1" type ( LoginReq { Username string `json:"username"` Password string `json:"password"` } LoginResp { Token string `json:"token"` } UserInfoReq { Id int64 `path:"id"` } UserInfoResp { Id int64 `json:"id"` Username string `json:"username"` Email string `json:"email"` } ) service user-api { @handler Login post /user/login (LoginReq) returns (LoginResp) } service user-api { @server ( jwt: Auth ) @handler GetUserInfo get /user/:id (UserInfoReq) returns (UserInfoResp) } - The error is
Error: user.api 30:5 syntax error: expected '@handler' | '}', got '@server'
Environments (please complete the following information):
- OS: [Linux]
- go-zero version [v1.10.0]
- goctl version [1.9.2 linux/amd64]
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels