On Thu, Feb 11, 2021 at 4:09 PM Trig <edb1...@gmail.com> wrote:
>
> So, in Go... you can either define imports, constants, types, variables one 
> at a time... or you can group them using brackets.  Why was it decided not to 
> be able to do that with functions?  Just curious.
>
> func (
>      main() {
>         fmt.Println(helloWorld())
>      }
>
>      helloWorld() string {
>         return "hello, world..."
>      }
> )

One reason is that it doesn't work very well for methods.  It could be
done, of course, but the resulting code doesn't look quite right.

Ian

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/CAOyqgcUQsfajRx6%3D5zxgyp19Cz5AAQu2ar3zOno1xScjrdX8Zw%40mail.gmail.com.

Reply via email to