gopherdata / gopherdata/gophernotes

notebook: defer is executed at the end of a cell

Ouverte
#150 7 commentaires 0 réactions 1 personne assignée Réclamée par @cosmos72 Voir sur GitHub
limitation
Langage dominant
Go
Étoiles
4k
Forks
264
Merge moyen
7 j 21 h
PR mergées (30 j)
1

Description

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.

Guide de contribution

Aucun guide de contribution indexé pour ce dépôt

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.