Optional params in Go?
问题 I know that there aren't any optional params in the latest version of Go . But there are quite a lot cases when they are really helpful. Consider oversimplified example: func getFullName(firstName string, lastName string, maybeMiddleName func() (bool, string)) string { if ok, middleName:= maybeMiddleName(); ok { return firstName + " " + middleName + " " + lastName } return firstName + " " + lastName } That looks fine enough, thought requires a lot verbosity on a client side: whenever