-
Notifications
You must be signed in to change notification settings - Fork 569
Closed
Description
According to the Go spec on slice expressions:
If the sliced operand of a valid slice expression is a
nil
slice, the result is anil
slice.
var s []int
s = s[0:0]
fmt.Println(s == nil) // should be true
GopherJS doesn't currently implement that. Slicing a nil
slice keeps it empty but makes it non-nil
:
I discovered this bug as part of the work to support Go 1.11, because this bug started to cause go/doc
tests to fail (see #836 (comment)).