compiler: provide .go
filename to Compile
First argument contains filename, thus we use '.go' suffix to distinguish between directories and files. Contract name should be provided in options. Signed-off-by: Evgeniy Stratonikov <evgeniy@nspcc.ru>
This commit is contained in:
parent
8af9c870b1
commit
e7a0ecb349
10 changed files with 35 additions and 28 deletions
|
@ -394,7 +394,9 @@ func handleLoadGo(c *ishell.Context) {
|
|||
c.Err(fmt.Errorf("%w: <file>", ErrMissingParameter))
|
||||
return
|
||||
}
|
||||
b, di, err := compiler.CompileWithOptions(c.Args[0], nil, nil)
|
||||
|
||||
name := strings.TrimSuffix(c.Args[0], ".go")
|
||||
b, di, err := compiler.CompileWithOptions(c.Args[0], nil, &compiler.Options{Name: name})
|
||||
if err != nil {
|
||||
c.Err(err)
|
||||
return
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue