FAQ
Is the outcome of this expected behavior?
http://play.golang.org/p/ryeMrrxDb4

Mitică

--
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

  • Rémy Oudompheng at Feb 19, 2013 at 8:35 pm

    On 2013/2/19 <itmitica@gmail.com>:
    Is the outcome of this expected behavior?
    http://play.golang.org/p/ryeMrrxDb4
    Yes, x == 0 matches false, and the fallthough statements make you go
    across all cases. A fallthrough does not imply an additional check
    against a case. Consider it equivalent to a "goto" to just after the
    next case.

    Rémy.

    --
    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.
  • Itmitica at Feb 19, 2013 at 8:38 pm
    Of course you are right, I forgot about that.
    http://play.golang.org/p/iusBWtbBiL

    Thanks,
    Mitică

    --
    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.
  • Maxim Khitrov at Feb 19, 2013 at 8:37 pm

    On Tue, Feb 19, 2013 at 3:32 PM, wrote:
    Is the outcome of this expected behavior?
    http://play.golang.org/p/ryeMrrxDb4

    Mitică
    x == 0 is false, false == false is true, so switch takes the first
    case and falls through to all others.

    - Max

    --
    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
postedFeb 19, '13 at 8:32p
activeFeb 19, '13 at 8:38p
posts4
users3
websitegolang.org

People

Translate

site design / logo © 2022 Grokbase