gopherdata / gopherdata/gophernotes

notebook: defer is executed at the end of a cell

Aperta
#150 7 commenti 0 reazioni 1 assegnatario Rivendicata da @cosmos72 Vedi su GitHub
limitation
Lingua principale
Go
Stelle
4k
Fork
264
Merge medio
7g 21h
PR unite (30g)
1

Descrizione

hi,

I am converting a few neugram.io-based notebooks to gopherdata+gomacro.

In these neugram notebooks, a `defer` would only be executed at the end of the notebook, not at the end of the cell/block. _e.g._:

```
// cell-1
f, err := os.Open(fname)
if err != nil {
panic(err)
}
defer f.Close()
```
```
// cell-2
_, err = f.Write([]byte("hello"))
if err != nil {
panic(err)
}
```

this would work in neugram, but fails with gomacro, as `f` has been closed in cell-1.

could this be fixed?

thanks.

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.