Expose package name of a compiled source
Exposing package name of the compiled source allows using it in `Eval`, as well as in logs and for other purposes.
This commit is contained in:
@@ -17,6 +17,11 @@ type Program struct {
|
||||
init []*node
|
||||
}
|
||||
|
||||
// PackageName returns name used in a package clause.
|
||||
func (p *Program) PackageName() string {
|
||||
return p.pkgName
|
||||
}
|
||||
|
||||
// FileSet is the fileset that must be used for parsing Go that will be passed
|
||||
// to interp.CompileAST().
|
||||
func (interp *Interpreter) FileSet() *token.FileSet {
|
||||
|
||||
Reference in New Issue
Block a user