FAQ
net.go:173: invalid slice index 0 - 1 (index must be non-negative)

huh?
Stuff(outputs[0-1])

Oops.

--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Search Discussions

  • Jan Mercl at Aug 3, 2013 at 10:09 pm

    On Sun, Aug 4, 2013 at 12:06 AM, Brendan Tracey wrote:
    net.go:173: invalid slice index 0 - 1 (index must be non-negative)

    huh?
    Stuff(outputs[0-1])

    Oops.
    Code?

    -j

    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Brendan Tracey at Aug 3, 2013 at 10:14 pm
    I'm in the middle of refactoring my code, so at the moment it's wrong (and obviously doesn't compile), but here's where the relevant subroutine currently stands

    http://play.golang.org/p/KZLozQ1zeM

    I had just absentmindedly copied the code in line 32 to 40, forgetting to change the limiting case.

    On Aug 3, 2013, at 3:09 PM, Jan Mercl wrote:

    On Sun, Aug 4, 2013 at 12:06 AM, Brendan Tracey
    wrote:
    net.go:173: invalid slice index 0 - 1 (index must be non-negative)

    huh?
    Stuff(outputs[0-1])

    Oops.
    Code?

    -j
    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • John Waycott at Aug 4, 2013 at 2:30 pm

    On Saturday, August 3, 2013 3:06:19 PM UTC-7, Brendan Tracey wrote:
    net.go:173: invalid slice index 0 - 1 (index must be non-negative)

    huh?
    Stuff(outputs[0-1])

    Oops.
    outputs[0-1] evaluates to outputs[-1], a negative index which is not
    allowed.

    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Brendan Tracey at Aug 4, 2013 at 4:24 pm
    I'm not confused, just commenting it's a nice error message.

    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Caleb Spare at Aug 5, 2013 at 9:17 am
    I think people (like myself) initially interpreted your post differently
    (i.e., the title was sarcasm).

    -Caleb
    On Sunday, August 4, 2013 9:24:38 AM UTC-7, Brendan Tracey wrote:

    I'm not confused, just commenting it's a nice error message.
    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupgolang-nuts @
categoriesgo
postedAug 3, '13 at 10:06p
activeAug 5, '13 at 9:17a
posts6
users4
websitegolang.org

People

Translate

site design / logo © 2022 Grokbase