On Mon, May 6, 2019 at 1:39 PM Nitish Saboo <nitish.sabo...@gmail.com> wrote:

> type Y struct {
>
> M string
> N string
>
> }
>
> func initalize() Y{
> // I have a func that return an object ob type Y.
> }
> var obj1 Y  = go  initalize()

No need to write Y above, the type will be inferred. However, see
https://golang.org/ref/spec#Go_statements The go statement is not an
expression while the `var foo = expr` requires an expression.

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