Send the return value directly to the channel

Is it possible to send the return value of a function directly to a golang feed? Below doesn't work:

BytesOutChan<-, err = bufio.NewWriter(conn).Write(...)

      

Is there a way to do this? Otherwise, is there a way to automatically add to the variable? For example, in C, you can do this:

myInt += fReturnsInt();

      

You can do this with golang, but is it possible with multiple return values? This would greatly reduce the verbosity of my code.

Thanks in advance.

+3


source to share


1 answer


Go lacks specific syntax to do what you want.



+2


source







All Articles