Thanks a lot for your polite and convenient replies. This time, I decided to use nested if-else instead of switch-fallthrough. As all of you mentioned, I have to avoid this. Maybe it's not Go style.
What I actually want to write is very little router that determines which to provide converted file or raw file. I want to use `http.FileServer` and `http.Dir` to provide raw file server and 404 responder because of its security advantages. Thank you. 2017年8月1日火曜日 21時35分00秒 UTC+9 Fumi Takeuchi: > > Example code: https://play.golang.org/p/dVtPVt3oKt > > --- > > I thought this code will work fine, but didn't, because of "fallthrough > statement out of place" error. > Maybe `fallthrough` statement cannot be used in `if` block even if it's > put inside `swicth` block) > > So, my question is, which is better measure to solve this. > > 1. Use if-else instead of switch > 2. Use goto (like this: https://play.golang.org/p/TILUCapta6) (I think > this should be avoided. I would confise LABEL expression with one case) > 3. Other (please comment) > > Thank you. > -- 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+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.