83}
84
85// AverageSizeFillPerMinute returns the average size of the order that has to be filled per second to reach the target amount
86func AverageSizeFillPerMinute(start time.Time, end time.Time, amount decimal.Decimal) decimal.Decimal {87 diff := end.Sub(start).Minutes()
88 a := amount.Div(decimal.NewFromFloat(diff)) // average size fill per minute
89 return a
If parameters of the same type lie consecutively, mention their type once at the end of the last parameter.
Unlike other languages, like C, where all parameters must be specified with types explicitly, it is not required to do so in Go. Combining the types is usually recommended for the sake of brevity.
func foo(a, b int, c, d int, e, f int, g int) {}
func foo(a, b, c, d, e, f, g int) {}