Skip to content

Commit

Permalink
remove unused parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
matt2e committed Jun 7, 2024
1 parent 2ef20ed commit c13df8f
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions go-runtime/compile/schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ func extractTopicDecl(pctx *parseContext, node *ast.CallExpr, stack []ast.Node)
}

func visitCallExpr(pctx *parseContext, node *ast.CallExpr, stack []ast.Node) {
validateCallExpr(pctx, node, stack)
validateCallExpr(pctx, node)

_, fn := deref[*types.Func](pctx.pkg, node.Fun)
if fn == nil {
Expand Down Expand Up @@ -406,12 +406,11 @@ func visitCallExpr(pctx *parseContext, node *ast.CallExpr, stack []ast.Node) {
// checks if the is directly:
// - calling external verbs
// - publishing to an external module's topic
func validateCallExpr(pctx *parseContext, node *ast.CallExpr, stack []ast.Node) {
func validateCallExpr(pctx *parseContext, node *ast.CallExpr) {
selExpr, ok := node.Fun.(*ast.SelectorExpr)
if !ok {
return
}

var lhsIdent *ast.Ident
if expr, ok := selExpr.X.(*ast.SelectorExpr); ok {
lhsIdent = expr.Sel
Expand All @@ -420,19 +419,16 @@ func validateCallExpr(pctx *parseContext, node *ast.CallExpr, stack []ast.Node)
} else {
return
}

lhsObject := pctx.pkg.TypesInfo.ObjectOf(lhsIdent)
if lhsObject == nil {
return
}

var lhsPkgPath string
if pkgName, ok := lhsObject.(*types.PkgName); ok {
lhsPkgPath = pkgName.Imported().Path()
} else {
lhsPkgPath = lhsObject.Pkg().Path()
}

var lhsIsExternal bool
if !pctx.isPathInPkg(lhsPkgPath) {
lhsIsExternal = true
Expand Down

0 comments on commit c13df8f

Please sign in to comment.