FAQ
As stated this is almost the opposite of a defer. It makes the code more concise but less clear.

Rather than a when keyword, something pre or preemt might work.

Preempt (func () { if err != nil { log.Print (err) } })()

This would then be called prior to any call instruction.

I still don't like it and prefer how Go is currently but it would be a more palatable alternative to your proposal for me.

--
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/d/optout.

Search Discussions

Discussion Posts

Previous

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 7 of 16 | next ›
Discussion Overview
groupgolang-nuts @
categoriesgo
postedMar 6, '16 at 3:54a
activeMar 8, '16 at 8:16p
posts16
users7
websitegolang.org

People

Translate

site design / logo © 2022 Grokbase