right now, when doing this (in Jupyter or directly in ng) one gets:
ng> import "os"
ng> f, err := os.Create("foo")
ng> if err != nil { panic(err) }
ng> defer f.Close()
ng: defer outside a function scope
as mentioned here we should probably put all the top-level code insider a "fake" "ng-main" function scope so we get a defer-context to hang all the top-level defers on to.
what do you think @crawshaw ?
would this break something somewhere?
(go test ./... didn't complain)
right now, when doing this (in Jupyter or directly in
ng
) one gets:as mentioned here we should probably put all the top-level code insider a "fake"
"ng-main"
function scope so we get a defer-context to hang all the top-leveldefer
s on to.what do you think @crawshaw ? would this break something somewhere? (
go test ./...
didn't complain)