mirror of
https://github.com/StackExchange/dnscontrol.git
synced 2025-01-18 05:18:40 +08:00
8 lines
215 B
Go
8 lines
215 B
Go
|
package diff2
|
||
|
|
||
|
// Return 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
|
||
|
}
|