You can use
var Gi = g.G(int)
or you can use
func Gi(i int) error { return g.G(i) }
for the same effect. Which is pretty much the reason why alias-declarations
ended up only be added for types - all other declarations can already be
emulated sufficiently well. :)


On Mon, Dec 3, 2018 at 11:39 PM Liam Breck <l...@networkimprov.net> wrote:

> Type aliases appear in the contracts draft design. Has anyone suggested
> alias declarations for generic functions? This would simplify syntax for
> callers...
>
> package g
>
> func G(type T)(i T) error { ... }
>
> ---
>
> package main
> import "g"
>
> func Gi g.G(int) // declare alias
>
> func f() {
>    Gi(1)
> }
>
> --
> 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.
>

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