Skip to content

Commit

Permalink
ctx.LoadFile: check name by ast file name
Browse files Browse the repository at this point in the history
  • Loading branch information
visualfc committed Apr 24, 2023
1 parent a0c2624 commit 4e56b34
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion context.go
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,7 @@ func (ctx *Context) LoadFile(filename string, src interface{}) (*ssa.Package, er
}
root, _ := filepath.Split(filename)
ctx.setRoot(root)
return ctx.LoadAstFile("main", file)
return ctx.LoadAstFile(file.Name.Name, file)
}

func (ctx *Context) ParseFile(filename string, src interface{}) (*ast.File, error) {
Expand Down

0 comments on commit 4e56b34

Please sign in to comment.