From ac040a6f22548c820f0c9796dc72b58d51335cf7 Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Tue, 28 Jul 2020 18:20:18 +0300 Subject: [PATCH] compiler: remove unused `resolveEntryPoint` Signed-off-by: Evgenii Stratonikov --- pkg/compiler/analysis.go | 22 ---------------------- 1 file changed, 22 deletions(-) diff --git a/pkg/compiler/analysis.go b/pkg/compiler/analysis.go index 3dc20a382..ab75b0c35 100644 --- a/pkg/compiler/analysis.go +++ b/pkg/compiler/analysis.go @@ -68,28 +68,6 @@ func isExprNil(e ast.Expr) bool { return ok && v.Name == "nil" } -// resolveEntryPoint returns the function declaration of the entrypoint and the corresponding file. -func resolveEntryPoint(entry string, pkg *loader.PackageInfo) (*ast.FuncDecl, *ast.File) { - var ( - main *ast.FuncDecl - file *ast.File - ) - for _, f := range pkg.Files { - ast.Inspect(f, func(n ast.Node) bool { - switch t := n.(type) { - case *ast.FuncDecl: - if t.Name.Name == entry { - main = t - file = f - return false - } - } - return true - }) - } - return main, file -} - // indexOfStruct returns the index of the given field inside that struct. // If the struct does not contain that field it will return -1. func indexOfStruct(strct *types.Struct, fldName string) int {