go-zero
go-zero copied to clipboard
Are the Demos working correctly.
Translated from English to Chinese compliments of Google 从英文翻译成中文的谷歌赞美
I have tried to generate some of the demos but I keep ending up with errors. Some won’t compile. The one that did compile errored when I run it rather giving the expected response.
我试图生成一些演示,但我一直以错误告终。 有些不会编译。 当我运行它时确实编译错误的那个,而不是给出预期的响应。
I’m following instructions from this page: https://go-zero.dev/docs/quick-start/monolithic-service/ 我正在按照此页面的说明进行操作: https://go-zero.dev/docs/quick-start/monolithic-service/
bob@Roberts-MacBook-Pro go-zero % pwd
/Users/bob/go/src/go-zero
bob@Roberts-MacBook-Pro go-zero % mkdir go-zero-demo
bob@Roberts-MacBook-Pro go-zero % cd go-zero-demo
bob@Roberts-MacBook-Pro go-zero-demo % go mod init go-zero-demo
go: creating new go.mod: module go-zero-demo
bob@Roberts-MacBook-Pro go-zero-demo % goctl api new greet
Done.
bob@Roberts-MacBook-Pro go-zero-demo % cd greet
bob@Roberts-MacBook-Pro greet % tree
.
├── etc
│ └── greet-api.yaml
├── greet.api
├── greet.go
└── internal
├── config
│ └── config.go
├── handler
│ ├── greethandler.go
│ └── routes.go
├── logic
│ └── greetlogic.go
├── svc
│ └── servicecontext.go
└── types
└── types.go
7 directories, 9 files
bob@Roberts-MacBook-Pro greet %
I then use goland to modify the “greetlogic.go”file. Before doing anything there are a lot of errors in the entire project. Attached are a couple of images from the IDE.
然后我使用goland修改"greetlogic。去"文件。 在做任何事情之前,整个项目都有很多错误。 附加的是来自IDE的几个图像
。
Thanks for your issue!
I can understand English, no need to translate.
I think you missed go mod tidy
.
Wow, Thank you for fast response. I did miss that. But, still have a problem.

Which goctl version are you using?
Make sure to use the latest version (v1.3.8).
goctl version 1.3.8 darwin/amd64
On Jul 2, 2022, at 1:05 AM, Kevin Wan @.***> wrote:
Which goctl version are you using?
— Reply to this email directly, view it on GitHub https://github.com/zeromicro/go-zero/issues/2069#issuecomment-1172842427, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAHRGMYGA4RJRPTKOGYZ2PLVR7L3JANCNFSM52GKGX6A. You are receiving this because you authored the thread.
Got it, thanks for reporting! We'll check and verify it.
@Bogeyduffer I have tried it again. that's work for me, It is possible that you go module does not work, Uh, I noticed that the project go-zero-demo
is in $GOPATH
(~/go/src)?,$GOPATH
is conflict with go module, you can try it again out of $GOPATH
, such as ~/workspace/go-zero-demo
This issue is stale because it has been open for 30 days with no activity.
This issue was closed because it has been inactive for 14 days since being marked as stale.