Skip to content

Commit

Permalink
Use errConstraintInterface
Browse files Browse the repository at this point in the history
  • Loading branch information
hoonmin committed Sep 24, 2023
1 parent 32ec09c commit 56f1d74
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions mockgen/generic_go118.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,12 +102,12 @@ func (p *fileParser) parseGenericMethod(field *ast.Field, it *namedInterface, if
typ = v.X
case *ast.UnaryExpr:
if v.Op == token.TILDE {
return nil, errIgnore
return nil, errConstraintInterface
}
return nil, fmt.Errorf("~T may only appear as constraint for %T", field.Type)
case *ast.BinaryExpr:
if v.Op == token.OR {
return nil, errIgnore
return nil, errConstraintInterface
}
return nil, fmt.Errorf("A|B may only appear as constraint for %T", field.Type)
default:
Expand Down

0 comments on commit 56f1d74

Please sign in to comment.