From 2290d22f0fae604c60f0b9910c3fa21956a6724a Mon Sep 17 00:00:00 2001 From: Ethan Wang <109973657+DBWGLX@users.noreply.github.com> Date: Sat, 18 Oct 2025 13:14:49 +0800 Subject: [PATCH] Revise setup instructions 1.In newer versions of Go, users can no longer use `go get` directly, so we need to run `go mod init` first. To install goctl, we need to use the `go install` command instead. 2.operations `expand` and `shorten` are both defined in `/shorturl/rpc/transform` --- doc/shorturl-en.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/doc/shorturl-en.md b/doc/shorturl-en.md index 38fede80..8c77d42f 100644 --- a/doc/shorturl-en.md +++ b/doc/shorturl-en.md @@ -60,6 +60,10 @@ And now, let’s walk through the complete flow of quickly creating a microservi * install etcd, mysql, redis +* create the working dir `shorturl` and `shorturl/api` + +* in `shorturl` dir, execute `go mod init shorturl` to initialize `go.mod` + * install protoc-gen-go ``` @@ -69,13 +73,9 @@ And now, let’s walk through the complete flow of quickly creating a microservi * install goctl ```shell - GO111MODULE=on go get -u github.com/zeromicro/go-zero/tools/goctl + go install github.com/zeromicro/go-zero/tools/goctl@latest ``` -* create the working dir `shorturl` and `shorturl/api` - -* in `shorturl` dir, execute `go mod init shorturl` to initialize `go.mod` - ## 5. Write code for API Gateway * use goctl to generate `api/shorturl.api` @@ -457,7 +457,7 @@ Till now, we’ve done the modification of API Gateway. All the manually added c } ``` -* modify `rpc/shorten/internal/logic/shortenlogic.go`, looks like: +* modify `rpc/transform/internal/logic/shortenlogic.go`, looks like: ```go func (l *ShortenLogic) Shorten(in *transform.ShortenReq) (*transform.ShortenResp, error) {