gopherdata/gophernotes

extra output?

PhilipLutley opened this issue · 1 comments

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

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

  • the number of printed characters
  • any error occurred while printing (nil in your case)

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