Skip to content

Commit

Permalink
Merge pull request #84 from cludden/cludden/cli-fix
Browse files Browse the repository at this point in the history
fix cross-package cli imports, repeated string flags
  • Loading branch information
cludden authored Dec 19, 2024
2 parents b3f3ee9 + 724b629 commit 7c69f56
Show file tree
Hide file tree
Showing 46 changed files with 123 additions and 123 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
### Fixed

- [#80](https://github.com/cludden/protoc-gen-go-temporal/pull/80) fix cross-package signal-with-start
- [#84](https://github.com/cludden/protoc-gen-go-temporal/pull/84) q



Expand Down
2 changes: 1 addition & 1 deletion gen/example/helloworld/v1/example.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions gen/example/helloworld/v1/example_temporal.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion gen/example/mutex/v1/mutex.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions gen/example/mutex/v1/mutex_temporal.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions gen/example/mutex/v1/mutexv1xns/mutex_xns_temporal.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion gen/example/schedule/v1/schedule.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions gen/example/schedule/v1/schedule_temporal.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion gen/example/searchattributes/v1/searchattributes.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion gen/example/updatabletimer/v1/updatabletimer.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions gen/example/updatabletimer/v1/updatabletimer_temporal.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion gen/example/v1/example.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions gen/example/v1/example_temporal.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions gen/example/v1/examplev1xns/example_xns_temporal.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion gen/example/xns/v1/xns.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions gen/example/xns/v1/xns_temporal.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions gen/example/xns/v1/xnsv1xns/xns_xns_temporal.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion gen/patch/go.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion gen/temporal/v1/temporal.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion gen/temporal/xns/v1/xns.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion gen/test/expression/v1/expression.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion gen/test/option/v1/option.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions gen/test/option/v1/option_temporal.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions gen/test/option/v1/optionv1xns/option_xns_temporal.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion gen/test/simple/common/v1/common.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion gen/test/simple/v1/simple.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions gen/test/simple/v1/simple_temporal.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions gen/test/simple/v1/v1xns/simple_xns_temporal.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion gen/test/xnserr/v1/xnserr.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions gen/test/xnserr/v1/xnserr_temporal.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions gen/test/xnserr/v1/xnserrv1xns/xnserr_xns_temporal.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 6 additions & 2 deletions internal/plugin/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -828,10 +828,10 @@ func (svc *Manifest) genCliUnmarshalMessage(f *g.File, msg *protogen.Message) {
oneof := field.Oneof

switch {
case field.Desc.IsList():
case field.Desc.IsList() && field.Desc.Kind() != protoreflect.StringKind:
fallthrough
case field.Desc.IsMap():
b.Var().Id("tmp").Id(name)
b.Var().Id("tmp").Qual(string(msg.GoIdent.GoImportPath), name)
b.If(
g.Err().Op(":=").Qual(protojsonPkg, "Unmarshal").Call(
g.Index().Byte().Call(g.Qual("fmt", "Sprintf").Call(g.Lit(fmt.Sprintf(`{"%s":%%s}`, field.Desc.JSONName())), g.Id("cmd").Dot("String").Call(g.Lit(flag)))),
Expand Down Expand Up @@ -944,6 +944,10 @@ func (svc *Manifest) genCliUnmarshalMessage(f *g.File, msg *protogen.Message) {
b.Id("result").Dot(oneof.GoName).Op("=").Op("&").Qual(string(field.GoIdent.GoImportPath), field.GoIdent.GoName).Values(g.Id(goName).Op(":").Id("cmd").Dot("String").Call(g.Lit(flag)))
return
}
if field.Desc.IsList() {
b.Id("result").Dot(goName).Op("=").Id("cmd").Dot("StringSlice").Call(g.Lit(flag))
return
}
b.Id("result").Dot(goName).Op("=").Id("cmd").Dot("String").Call(g.Lit(flag))
}
})
Expand Down
2 changes: 0 additions & 2 deletions internal/plugin/plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package plugin

import (
"fmt"
"io"
"runtime"
"strings"

Expand Down Expand Up @@ -37,7 +36,6 @@ type Plugin struct {
Version string
cfg *Config
flags *pflag.FlagSet
stderr io.WriteCloser
}

func New(commit, version string) *Plugin {
Expand Down
Loading

0 comments on commit 7c69f56

Please sign in to comment.