Closed Jamlee closed 1 year ago
hi @Jamlee , thanks for the report. Coincidentally I noticed this yesterday and already fixed it at v0.2.1
.
I tested your code here and it seems working.
If you do:
$ go install github.com/janpfeifer/gonb@latest
$ gonb --install
And restart your kernel, it should pick it up.
Let me know if it works! And sorry for the bump...
it was fixed. 👍
After the fix I caught also another issue: when changing the definition of method to a different type of receiver (from Pointer to Value or the otherway round) GoNB wouldn't redefine it and would include both, which then lead to failure.
This is fixed in v0.3.0
, along with contextual help, which now also requires now installation of gopls
.
$ go install golang.org/x/tools/gopls@latest
Marking as fixed/closed, but if you see more issues, pls let me know.
@janpfeifer Hi
File: "main" [6fe4fbbe] 2023/02/12 12:19:28 Executing: /tmp/gonb_6fe4fbbe/gonb_6fe4fbbe [] [6fe4fbbe] 2023/02/12 12:19:28 Execution finished successfully [6fe4fbbe] 2023/02/12 12:19:28 Reply(execute_reply): [6fe4fbbe] 2023/02/12 12:19:28 PublishKernelStatus() [6fe4fbbe] 2023/02/12 12:19:56 PublishKernelStatus() File: "main" [6fe4fbbe] 2023/02/12 12:19:56 PublishKernelStatus() panic: interface conversion: ast.Expr is ast.StarExpr, not ast.Ident
goroutine 29 [running]: github.com/janpfeifer/gonb/goexec.(State).ParseImportsFromMainGo(0xc00006efc0, 0xc000136c60, 0xc000153790) /root/go/pkg/mod/github.com/janpfeifer/gonb@v0.1.0/goexec/parser.go:84 +0x9ec github.com/janpfeifer/gonb/goexec.(State).ExecuteCell(0xc00006efc0, 0xbb?, {0xc0001370e0?, 0x11?, 0x0?}, 0x0?) /root/go/pkg/mod/github.com/janpfeifer/gonb@v0.1.0/goexec/execcode.go:31 +0x36b github.com/janpfeifer/gonb/dispatcher.handleExecuteRequest(0xc000136c60, 0x6a7cde?) /root/go/pkg/mod/github.com/janpfeifer/gonb@v0.1.0/dispatcher/dispatcher.go:244 +0x425 github.com/janpfeifer/gonb/dispatcher.handleMsg(0xc000136c60, 0xc000153f58?) /root/go/pkg/mod/github.com/janpfeifer/gonb@v0.1.0/dispatcher/dispatcher.go:97 +0x1fa github.com/janpfeifer/gonb/dispatcher.RunKernel.func1.1() /root/go/pkg/mod/github.com/janpfeifer/gonb@v0.1.0/dispatcher/dispatcher.go:35 +0x113 created by github.com/janpfeifer/gonb/dispatcher.RunKernel.func1 /root/go/pkg/mod/github.com/janpfeifer/gonb@v0.1.0/dispatcher/dispatcher.go:28 +0xea
error line is : 89,(*ast.Ident).Name https://github.com/janpfeifer/gonb/blob/e732dac36d766f8af59045168b5df9b23290ac70/goexec/parser.go#L84-L89