Trouble Shooting
command not found: goctl
when executing commands.#
1. goctl has already installed, but it shows If you installed via go get
, then goctl
should be located in $GOPATH
.
You can check the full path with go env GOPATH
, whether your goctl
is in $GOPATH
Whether your goctl
is in $GOPATH
or in another directory, the reason for the above problem is that the directory where goctl
is located is not in PATH
(environment variable).
#
2. How to call rpcYou can refer to [rpc writing and calling] in the Quick Start (...) for this question. /advance/rpc-call), which describes the logic for using rpc calls.
#
3. proto uses import, how the goctl command needs to be written.goctl
for import proto specifies BasePath
provides protoc
flag mapping, i.e. --proto_path, -I
.
goctl
will pass this flag value to protoc
.
base.proto
is introduced by main proto, why not generate base.pb.go
.#
4. Assuming that For a file like base.proto
, the developer usually has a need for message reuse, and the source is not only the proto
file written by the developer, but also the google.proto
file.
It may also come from some basic proto provided in google.golang.org/grpc
, such as google/protobuf/any.proto
, if generated by goctl
then the point of centralizing these proto's would be lost.
#
5. How does the model control the cache timeNewNodeConncan be passed with the optional parameter
cache.WithExpiry` to control the cache time to 1 day, for example, with the following code:
#
6. jwt forensics how to implementPlease refer to [jwt forensics](... /advance/jwt)
#
7. how to use api middlewarePlease refer to [middleware](... /advance/middleware) /advance/middleware)
#
8. how to disable the output statistics log (stat)?logx.DisableStat()
#
9. rpc direct connection and service discovery connection mode writingfaq will update from time to time the problems you encounter, you are also welcome to write the common problems here via pr.