mirror of
https://github.com/StackExchange/dnscontrol.git
synced 2024-11-14 20:24:39 +08:00
7 lines
223 B
Go
7 lines
223 B
Go
package diff2
|
|
|
|
// highest returns the highest valid index for an array. The equiv of len(s)-1, but with
|
|
// less likelihood that you'll commit an off-by-one error.
|
|
func highest[S ~[]T, T any](s S) int {
|
|
return len(s) - 1
|
|
}
|