Multiple return values. They do kinda exist in a declarative form of sorts, in the type signature, this sets the number and sequence and types of return values. You could even make functions accept them as also input values, I think, but I don't think it works exactly like this. I'm not a fan of these things because of how you have to nominate variables or _ and type inference will make these new variables, if you := into whatever the return was.
I'm not sure what the correct word is for them. Untyped in the same way that literals can be multiple types (especially integers) but singular in their literal form. On Thursday, 19 April 2018 16:06:42 UTC+3, Jan Mercl wrote: > > On Thu, Apr 19, 2018 at 2:51 PM Louki Sumirniy <louki.sumir...@gmail.com > <javascript:>> wrote: > > > Sorry for the self-promotion but it was relevant in that I was working > on how to tidy up the readability of my code and needed multiple returns > and simple untyped tuples were really not nearly as convenient as using a > type struct. > > I have no idea what you mean by 'untyped tuples' because Go does not have > tuples, or at least not as a well defined thing. I can only guess if you're > trying to implement tuples in Go with an array, slice or a struct, ...? To > add to my confusion, Go functions can have as many return values as one > wishes just fine, ie. I obviously do not even understand what problem > you're trying to solve. Sorry. > > > -- > > -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+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.