Skip to content

Commit

Permalink
feat: support hz sdk
Browse files Browse the repository at this point in the history
  • Loading branch information
li-jin-gou committed Mar 9, 2025
1 parent 2256067 commit d552c83
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions cmd/hz/thrift/plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ func (plugin *Plugin) Run() int {
return meta.PluginError
}

args, err = plugin.parseArgs()
args, err = plugin.parseArgs(req)
if err != nil {
logs.Errorf("parse args failed: %s", err.Error())
return meta.PluginError
Expand Down Expand Up @@ -229,12 +229,12 @@ func (plugin *Plugin) recvVerboseLogger() string {
return verboseLog
}

func (plugin *Plugin) parseArgs() (*config.Argument, error) {
if plugin.req == nil {
func (plugin *Plugin) parseArgs(req *thriftgo_plugin.Request) (*config.Argument, error) {
if req == nil {
return nil, fmt.Errorf("request is nil")
}
args := new(config.Argument)
err := args.Unpack(plugin.req.PluginParameters)
err := args.Unpack(req.PluginParameters)
if err != nil {
logs.Errorf("unpack args failed: %s", err.Error())
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/hz/thrift/plugin_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ func TestRun(t *testing.T) {

plu.req = req

_, err = plu.parseArgs()
_, err = plu.parseArgs(req)
if err != nil {
t.Fatal(err)
}
Expand Down

0 comments on commit d552c83

Please sign in to comment.