3 ms·
Your fix is wrong, so the site rejects it. Go doesn't do integer type conversions implicitly, to avoid the implicit-type-casting bugs endemic to C. Go (thankfu
by bugfix-66 4y ago
Your fix is wrong, so the site rejects it.
Go doesn't do integer type conversions implicitly, to avoid the implicit-type-casting bugs endemic to C. Go (thankfully) doesn't allow an implicit conversion from int to byte. You must do the cast explicitly.
So you would have to say
to = append(to, byte(ctrl))
and that's correct.
The site builds and executes the code you submit, and any correct solution is accepted.