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

fix: quickstart dont work

Open yunfan opened this issue 1 year ago • 5 comments
trafficstars

the default quickstart section do not work for the command order this would failed beginner and prevent their going on learning, so after i fingered out the fixing, i just want to contributed it back to you

yunfan avatar May 23 '24 13:05 yunfan

Maybe deleted go mod init should be work.

kesonan avatar Jun 02 '24 12:06 kesonan

go version go1.22.3 linux/amd64

yunfan avatar Jun 03 '24 00:06 yunfan

image I can generate code by executing goctl api new greet, but an error ocurred while running the project, do you mean it can not work beacuse of this issue block your learning step?

kesonan avatar Jun 04 '24 14:06 kesonan

@kesonan not only the failing blocked my learning path but also the steps has other issues in the middle, please check the following screenshots

x_000 x_001

as showed above, if i began with a fresh directory, it will has problem when running go mod init which required my gaving the mod name , and after i gaved the mod name to init, it then caused bigger problem when running the sample code

and i paste the generated code here sample.zip

yunfan avatar Jun 05 '24 00:06 yunfan

Your problem looks like the go environment has not been handled properly, you can check from the following aspects:

  1. whether the go module feature is enabled
  2. whether it is under the gopath directory

kesonan avatar Jun 28 '24 02:06 kesonan