Are there any plans to support generics?
Rewriting with generics could largely reduce the risk of exposing runtime panics and converting them into compile-time errors.
For example:
func (accounting *Accounting) FormatMoney(value interface{}) string
The FormatMoney function takes in any type and does type a check only at runtime.
Happy to help with the refactor if it sounds like a good idea.
Are there any plans to support generics?
Rewriting with generics could largely reduce the risk of exposing runtime panics and converting them into compile-time errors.
For example:
The
FormatMoneyfunction takes inanytype and does type a check only at runtime.Happy to help with the refactor if it sounds like a good idea.