Proposal Details
Go currently does not support function aliases. However, you can simulate function aliases using wrapper functions.
func X(args) { package.FuncX(args) }
This approach has the negatives of verbosity.
or through variable assignments
var X = somepackage.FuncX
This approach has the negatives of access to X
being dynamic and the cost associated with that (eg. escape analysis, harder to inline etc.)
I propose the following succinct syntax similar to type aliases to improve upon the var X = ..
form.
func X = somepackage.FuncX
Regarding generics - if FuncX
is a generic function then X
would be one as well.
Currently var X = somepackage.FuncX
doesn't work when FuncX
is generic.