Skip to content

Commit

Permalink
fix --dig-manually skip (#554) (#568)
Browse files Browse the repository at this point in the history
  • Loading branch information
relipocere authored Jul 22, 2022
1 parent 5d686a5 commit 9f3b1d2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
5 changes: 4 additions & 1 deletion fill/proto/interactive_filler.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,9 @@ func (r *resolver) resolve() (*dynamic.Message, error) {
}

err := r.resolveField(f)
if errors.Is(err, prompt.ErrSkip) {
continue
}
if errors.Is(err, prompt.ErrAbort) {
return r.msg, nil
}
Expand Down Expand Up @@ -138,7 +141,7 @@ func (r *resolver) resolveField(f *desc.FieldDescriptor) error {
switch t := f.GetType(); t {
case descriptorpb.FieldDescriptorProto_TYPE_MESSAGE:
if r.skipMessage(f) {
return nil, prompt.ErrAbort
return nil, prompt.ErrSkip
}

msgr := newResolver(
Expand Down
1 change: 1 addition & 0 deletions prompt/prompt.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ var (
)

var (
ErrSkip = errors.New("skip")
ErrAbort = errors.New("abort")
)

Expand Down

0 comments on commit 9f3b1d2

Please sign in to comment.