I was wondering what the best way is to allow optional arguments when calling a function/method - the idea really is that I don’t want to force a person to set values that’d be used by something like time.Sleep inside the function that’s being called …
If I want to call the func f() I will have to provide a delay f(time.Duration(0)), even if I don’t want / need to as the default value for time.Duration is a int64(0) and if I don’t want to set a delay, then 0 is fine by me.
Any suggestions? Maybe one that isn’t use variadic function arg as the args may be of different “type”, e.g. mix of multiples of (optional) delays + optional func(), etc. ?