From 2ee7091933d2c07338dfb4699ce5665951b47afd Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Thu, 16 Mar 2023 18:38:11 -0400 Subject: tree-wide: Ensure that all packages have a doc comment --- lib/slices/sliceutil.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'lib/slices') diff --git a/lib/slices/sliceutil.go b/lib/slices/sliceutil.go index 567f9ec..9fe5be4 100644 --- a/lib/slices/sliceutil.go +++ b/lib/slices/sliceutil.go @@ -1,7 +1,9 @@ -// Copyright (C) 2022 Luke Shumaker +// Copyright (C) 2022-2023 Luke Shumaker // // SPDX-License-Identifier: GPL-2.0-or-later +// Package slices implements generic (type-parameterized) utilities +// for working with simple Go slices. package slices import ( -- cgit v1.2.3-2-g168b From e082cfb3b8f8226067078cc410e4997fd1cf14df Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Thu, 16 Mar 2023 18:45:45 -0400 Subject: tree-wide: Ensure that all existing method doc comments follow the expected format --- lib/slices/sliceutil.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'lib/slices') 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 - - - // : ^ -- cgit v1.2.3-2-g168b