On Friday, January 6, 2017 at 4:01:32 AM UTC+2, hui zhang wrote:
>
>
> check code below
> func foo() (int32,int32) {
> .....
> }
> var a,b int16
> a, b = (int16, int16)foo()
>
> I want to cast multi return value ,  but it seems impossible in go,  how 
> can I do that
> I just want to make my code short , and not wish to create useless temp 
> variable
>
>
>

Hi,
you can use function to convert types:
https://play.golang.org/p/2mBwvXhUI9
 
Djadala

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

Reply via email to