gopherdata / gophernotes

The Go kernel for Jupyter notebooks and nteract.
MIT License
3.86k stars 263 forks source link

extra output? #247

Closed PhilipLutley closed 2 years ago

PhilipLutley commented 2 years ago

This is probably down to my lack of understanding notebooks..

Is there any way I can get rid of the extra output cell? It's giving me my output plus an extra character count cell (I think).

Screenshot 2022-02-20 172748

cosmos72 commented 2 years ago

The output cell shows the values returned by the last expression - in your case, fmt.Println(...) returns two values:

This is a general feature, and useful in many cases - see this screenshot for an example image

If you want to suppress the values returned by the last expression, you can assign them to _ or wrap the expression inside { ... } to convert it to a statement (Go statements do not return values) - for example image