gopherdata / gopherdata/gophernotes
notebook: defer is executed at the end of a cell
Đang mở
limitation
- Ngôn ngữ chính
- Go
- Star
- 4k
- Fork
- 264
- Merge trung bình
- 7 ngày 21 giờ
- Pull request đã merge (30 ngày)
- 1
Mô tả
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.
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
Đánh giá
Issue này chưa được đánh giá.