- FAQ
- 1.
google/protobuf/descriptor.proto: File not found.
error while usingkratos proto
command. - 2. There are errors from IDE show
import "google/api/annotations.proto";
with red wavy line - 3. Develop with goland
- 4. The code newly generated after the new release is unavailable, with system alarming errors.
- 5. After invoke
kratos client
, there are no deserved http file. - 6. It show
Command not found: kratos
after installed Kratos - 7. It show some proto file not found when generate pb file.
- 8.There are
// no validation rules for xxxx
for configurated property. - 9. Custom Http return value
- 1.
FAQ
1. google/protobuf/descriptor.proto: File not found.
error while using kratos proto
command.
This issue is mainly caused by the improperly installation of protoc. The documentation protoc-installation shows the correct way to install protoc. It is highly recommended that install protoc by system package manager to ensure the installation’s integrity. If you have to install the pre-compiled version, please refer to the readme.txt
in the zip file, make sure all the files under include
folder could be put to correct include path of your system, e.g. /usr/local/include/
, so that protoc can find them while compiling.
2. There are errors from IDE show import "google/api/annotations.proto";
with red wavy line
You can append thrid_party
directory to custom protobuf`s include paths. Please follow these doc:
3. Develop with goland
All you need to do is configurate some setting like this:
4. The code newly generated after the new release is unavailable, with system alarming errors.
You can try to follow this:
- kratos upgrade
- Modify the version of kratos in
go.mod
file - go generate ./…
5. After invoke kratos client
, there are no deserved http file.
You can run make http
or kratos client xxx --go-http_opt=omitempty=false
6. It show Command not found: kratos
after installed Kratos
Make sure the env value PATH
contain GOBIN
directory. Or you can invoke kratos
inside GOBIN
directory.
7. It show some proto file not found when generate pb file.
Copy the missing proto file to third_party
directory. Or append missing proto file location to corresponding Makefile command.
8.There are // no validation rules for xxxx
for configurated property.
git clone github.com/envoyproxy/protoc-gen-validate
cd protoc-gen-validate
make build
9. Custom Http return value
You can write a custom ResponseEncoder
and set to http.Server()
by using http.ResponseEncoder()