I have to agree. The idiomatic solution would be defining multiple functions that wrap around another, and it is not onerously boilerplatey. As Ian says, default values do constitute effectively function overloads.
There is reason why function overloading is not available in Go. Just go look at some typical c++ code. Not only overloading but operator overloading as well. Looking at one source file you may not be able to figure out what any symbol in the file actually refers to. Watch the way symbol analysis tools like Codelens give you references to a given symbol... I know in the bitcoin codebase, nearly every symbol in the whole damn codebase codelens suggests like 5 different definitions for everything. One of them is correct, of course, but the only way to find out is to compile it, and an eternity later it just does stuff and because the source code is so difficult to analyse, you are still none the wiser. I would think that for those who really really need such feature, the solution would be with using a code generator/preprocessor. But then you will lose a lot of the advantage of writing it in Go in the first place. On Friday, 24 August 2018 02:51:37 UTC+2, andrey mirtchovski wrote: > > > You're right but I think developers of Go can think about that because > its benefits are obvious. > > can you please enumerate those benefits? many gophers are not > convinced they are obvious. > -- 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.