FAQ
Sorry - I messed up the 'expansion' in my last post.

The point is that the ^ call will return _from the calling function_, so
(in the correct expansion):

db, ^errF := sql.Open(...)

becomes

db, _temp_err := sql.Open(...)
if nil!=_temp_err {
return errF(_temp_err)
}

So the return from the ^ function becomes the return from the calling
function.

All the best,
C
On Saturday, April 6, 2013 2:11:02 PM UTC+2, Jesse McNelis wrote:

On Sat, Apr 6, 2013 at 11:00 PM, Craig Mason-Jones <cr...@lateral.co.za<javascript:>
wrote:
Rewritten with ^:

338 errF := func(e error) error { // ^ only called if param !=
nil
339 return e
340 }
This function doesn't do anything. I don't see the point of it.
If the '^' operator is supposed to pass the value to the named function if
it's not nil then you still don't have anything to change the flow of the
program. eg. How does this help you return the error to the caller?
--
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

Discussion Posts

Previous

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 11 of 19 | next ›
Discussion Overview
groupgolang-nuts @
categoriesgo
postedApr 5, '13 at 7:31a
activeApr 12, '13 at 6:37a
posts19
users11
websitegolang.org

People

Translate

site design / logo © 2021 Grokbase