summaryrefslogtreecommitdiff
path: root/lib/slices/sliceutil.go
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@lukeshu.com>2023-03-16 18:45:45 -0400
committerLuke Shumaker <lukeshu@lukeshu.com>2023-03-17 02:51:43 -0400
commite082cfb3b8f8226067078cc410e4997fd1cf14df (patch)
tree4fe651510fa4179e875f82aebdc7405b3b752c7a /lib/slices/sliceutil.go
parent2ee7091933d2c07338dfb4699ce5665951b47afd (diff)
tree-wide: Ensure that all existing method doc comments follow the expected format
Diffstat (limited to 'lib/slices/sliceutil.go')
-rw-r--r--lib/slices/sliceutil.go8
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/slices/sliceutil.go b/lib/slices/sliceutil.go
index 9fe5be4..b8823d3 100644
--- a/lib/slices/sliceutil.go
+++ b/lib/slices/sliceutil.go
@@ -95,7 +95,7 @@ func max(a, b int) int {
return b
}
-// Search the slice for a value for which `fn(slice[i]) = 0`.
+// Search searches the slice for a value for which `fn(slice[i]) = 0`.
//
// : + + + 0 0 0 - - -
// : ^ ^ ^
@@ -123,7 +123,8 @@ func Search[T any](slice []T, fn func(T) int) (int, bool) {
return 0, false
}
-// Search the slice for the left-most value for which `fn(slice[i]) = 0`.
+// SearchLowest searches the slice for the left-most value for which
+// `fn(slice[i]) = 0`.
//
// : + + + 0 0 0 - - -
// : ^
@@ -153,7 +154,8 @@ func SearchLowest[T any](slice []T, fn func(T) int) (int, bool) {
return firstGood, true
}
-// Search the slice for the right-most value for which `fn(slice[i]) = 0`.
+// SearchHighest searches the slice for the right-most value for which
+// `fn(slice[i]) = 0`.
//
// : + + + 0 0 0 - - -
// : ^