From 95f68935472e411b1a692c24d78378aaed4d5fc9 Mon Sep 17 00:00:00 2001 From: wineandchord Date: Fri, 20 Oct 2023 20:45:36 +0800 Subject: [PATCH] fix test --- cmd/create/cmdflags.go | 2 +- cmd/create/generate.go | 2 +- util/pb/option.go | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cmd/create/cmdflags.go b/cmd/create/cmdflags.go index 654e723..ad04a44 100644 --- a/cmd/create/cmdflags.go +++ b/cmd/create/cmdflags.go @@ -42,7 +42,7 @@ func AddCreateFlags(createCmd *cobra.Command) { createCmd.Flags().Bool("secvenabled", false, "Enable generation of validate.go file using protoc-gen-secv, defaults to false") createCmd.Flags().Bool("validate", false, - "Enable generation of validate.go file using protoc-gen-validate, defaults to false") + "Enable generation of validate.pb.go file using protoc-gen-validate, defaults to false") createCmd.Flags().String("kvfile", "", "Provide a json file path to unmarshal into key-value pairs (KVs) for usage in template files") createCmd.Flags().String("kvrawjson", "", diff --git a/cmd/create/generate.go b/cmd/create/generate.go index b9afe29..3b75bd1 100644 --- a/cmd/create/generate.go +++ b/cmd/create/generate.go @@ -358,7 +358,7 @@ func (g *genDependencyRPCStubParam) genDependencyRPCStubPB() error { searchPath, g.fname, g.option.Language, g.outputDir, append(opts, pb.WithSecvEnabled(true))..., ); err != nil { - return fmt.Errorf("generate validation file for %s err: %w", g.fname, err) + return fmt.Errorf("generate secv file for %s err: %w", g.fname, err) } } // Run protoc-gen-validate. diff --git a/util/pb/option.go b/util/pb/option.go index 9f5c245..84ee691 100644 --- a/util/pb/option.go +++ b/util/pb/option.go @@ -34,7 +34,7 @@ func WithSecvEnabled(enabled bool) Option { // https://github.com/bufbuild/protoc-gen-validate/tree/v1.0.2 func WithValidateEnabled(enabled bool) Option { return func(o *options) { - o.secvEnabled = enabled + o.validationEnabled = enabled } }