You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@josharian I don't think this bug only happens for []byte, I think it happens for all "collections"/arrays/slices so [] ie []string, []int, []struct. Please see https://play.golang.org/p/c2vPXbl0Ew
or inlined
prog.go:4: too many arguments to conversion to []int: ([]int)(<N>)
prog.go:5: too many arguments to conversion to []byte: ([]byte)(<N>)
prog.go:6: too many arguments to conversion to []string: ([]string)(<N>)
prog.go:9: too many arguments to conversion to int: int(15, "a")
prog.go:10: too many arguments to conversion to string: string("n", "e", "w")
prog.go:11: too many arguments to conversion to byte: byte("info", "a$ap")
Notice that the obscure error message only happens when we have []<Type>
Try to compile
_ = []byte("abc", "def")
.http://play.golang.org/p/b8yffUjLNq
Result:
too many arguments to conversion to []byte: ([]byte)(<N>)
That error message is unhelpful; it looks like we have an unexpectedly nil Node.
The text was updated successfully, but these errors were encountered: