Skip to content

Commit 8d98537

Browse files
committed
update README.md: replace command
1 parent 6d3d9fb commit 8d98537

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

README.md

+7-3
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@ go build
2121
## Usage
2222
To generate Hessian2 code using `protoc-gen-go-hessian2`, you can use the following command:
2323
```shell
24-
protoc --go-hessian2_out=. --go-hessian2_opt=paths=source_relative your_file.proto
24+
protoc -I ./ \
25+
--go-hessian2_out=./ --go-hessian2_opt=paths=source_relative \
26+
./greet.proto
2527
```
2628
The `--go-hessian2_out` option specifies the output directory for the generated code,
2729
and `--go-hessian2_opt=paths=source_relative` sets the output path to be relative to the source file.
@@ -33,7 +35,7 @@ syntax = "proto3";
3335
3436
package greet;
3537
36-
option go_package = ";greet";
38+
option go_package = "some_path/greet;greet";
3739
3840
import "unified_idl_extend/unified_idl_extend.proto";
3941
@@ -58,7 +60,9 @@ and set `java_class_name` to the corresponding Java class name.
5860

5961
Then, you can run the following command to generate the Hessian2 code:
6062
```shell
61-
protoc --go-hessian2_out=. --go-hessian2_opt=paths=source_relative greet/greet.proto
63+
protoc -I ./ \
64+
--go-hessian2_out=./ --go-hessian2_opt=paths=source_relative \
65+
./greet.proto
6266
```
6367

6468
This will generate the `greet.hessian2.go` file in the same directory as your `greet.proto` file:

0 commit comments

Comments
 (0)