github.com/machinefi/w3bstream@v1.6.5-rc9.0.20240426031326-b8c7c4876e72/pkg/depends/x/pkgx/pkgx_results.go (about)

     1  package pkgx
     2  
     3  import (
     4  	"go/ast"
     5  	"go/types"
     6  )
     7  
     8  type TypeAndValueExpr struct {
     9  	ast.Expr
    10  	types.TypeAndValue
    11  }
    12  
    13  type Results map[int][]TypeAndValueExpr
    14  
    15  func IsBlockContainsReturn(n ast.Node) (ok bool) {
    16  	ast.Inspect(n, func(node ast.Node) bool {
    17  		_, ok = n.(*ast.ReturnStmt)
    18  		return true
    19  	})
    20  	return
    21  }