Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion testdata/src/a/define.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (

type a struct {
ct ct
ict interface{ Err(context.Context) error }
ict ict
}

func g() error {
Expand Down Expand Up @@ -51,5 +51,6 @@ func (r) r(context.Context) []*ct {

type ict interface {
Err(context.Context) error
Result() (struct{}, error)
}
type mmu []ict
7 changes: 7 additions & 0 deletions testdata/src/a/struct-field.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,4 +75,11 @@ func (a *a) A(ctx context.Context) {
if err := a.ict.Err(ctx); err != nil {
_ = fmt.Errorf("a.ict.Err: %w", err)
}
_, err := a.ict.Result()
if err != nil {
_ = fmt.Errorf("hoge: %w", err) // want `the error-wrapping message should be "a\.ict\.Result: %w"`
}
if err != nil {
_ = fmt.Errorf("a.ict.Result: %w", err)
}
}
7 changes: 7 additions & 0 deletions testdata/src/a/struct-field.go.golden
Original file line number Diff line number Diff line change
Expand Up @@ -75,4 +75,11 @@ func (a *a) A(ctx context.Context) {
if err := a.ict.Err(ctx); err != nil {
_ = fmt.Errorf("a.ict.Err: %w", err)
}
_, err := a.ict.Result()
if err != nil {
_ = fmt.Errorf("a.ict.Result: %w", err) // want `the error-wrapping message should be "a\.ict\.Result: %w"`
}
if err != nil {
_ = fmt.Errorf("a.ict.Result: %w", err)
}
}
2 changes: 2 additions & 0 deletions walk.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ func (w *walker) walk(ctx context.Context, depth int, v poser) ([]string, bool)
return w.walkOperands(ctx, depth+1, v)
case *ssa.ChangeInterface:
return w.walkOperands(ctx, depth+1, v)
case *ssa.Extract:
return w.walkOperands(ctx, depth+1, v)
case *ssa.Call:
return formatCall(ctx, v)
}
Expand Down