Re: [go-nuts] Grouped functions...

2021-02-12 Thread Brian Candler
> I'd really love to see local functions, though, not for real scope usage but for clarity of coding. You kind-of can: https://play.golang.org/p/8BeeIb_azUM But if you're not interested in accessing variables in the enclosing scope, you might as well put them as non-exported functions at the to

Re: [go-nuts] Grouped functions...

2021-02-12 Thread Paul Förster
Hi Trig, I'm new to the list and I'm a Go newbie, but > On 12. Feb, 2021, at 01:09, Trig 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?

Re: [go-nuts] Grouped functions...

2021-02-11 Thread Ian Lance Taylor
On Thu, Feb 11, 2021 at 4:09 PM Trig 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

[go-nuts] Grouped functions...

2021-02-11 Thread Trig
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 {