go-zero icon indicating copy to clipboard operation
go-zero copied to clipboard

Are the Demos working correctly.

Open Bogeyduffer opened this issue 2 years ago • 7 comments

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的几个图像 go-zero-demo – greetlogic go 2022-06-29 11-05-35 go-zero-demo – greetlogic go 2022-06-29 11-03-09

Bogeyduffer avatar Jun 29 '22 16:06 Bogeyduffer

Thanks for your issue!

I can understand English, no need to translate.

I think you missed go mod tidy.

kevwan avatar Jun 29 '22 16:06 kevwan

Wow, Thank you for fast response. I did miss that. But, still have a problem.

go-zero-demo – greethandler go 2022-06-29 11-36-29 .

Bogeyduffer avatar Jun 29 '22 16:06 Bogeyduffer

Which goctl version are you using?

Make sure to use the latest version (v1.3.8).

kevwan avatar Jul 02 '22 06:07 kevwan

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.

Bogeyduffer avatar Jul 02 '22 12:07 Bogeyduffer

Got it, thanks for reporting! We'll check and verify it.

kevwan avatar Jul 02 '22 16:07 kevwan

@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

kesonan avatar Jul 03 '22 12:07 kesonan

This issue is stale because it has been open for 30 days with no activity.

github-actions[bot] avatar Aug 03 '22 02:08 github-actions[bot]

This issue was closed because it has been inactive for 14 days since being marked as stale.

github-actions[bot] avatar Aug 17 '22 02:08 github-actions[bot]