diff --git a/fs/reader.go b/fs/reader.go index 4fe49d6..0f6a4f5 100644 --- a/fs/reader.go +++ b/fs/reader.go @@ -2,7 +2,7 @@ package fs import "io/fs" -// ReaderFS combines all teh reader file system interfaces into a single +// ReaderFS combines all the reader file system interfaces into a single // interface for convenience. type ReaderFS interface { fs.GlobFS diff --git a/slices/manipulate.go b/slices/manipulate.go index 25de026..002350d 100644 --- a/slices/manipulate.go +++ b/slices/manipulate.go @@ -75,10 +75,8 @@ func Unshift[T any](slice []T, vs ...T) []T { for range vs { slice = append(slice, zero) } - copy(slice[len(vs):], slice[:]) - for i, v := range vs { - slice[i] = v - } + copy(slice[len(vs):], slice) + copy(slice, vs) return slice } diff --git a/slices/map.go b/slices/map.go index 8dd7071..3f79600 100644 --- a/slices/map.go +++ b/slices/map.go @@ -193,7 +193,7 @@ func FirstIndex[T any](in []T, pred func(t T) bool) int { return -1 } -// FirstOr returns the first tiem that matches the predicate. If nothing +// FirstOr returns the first time that matches the predicate. If nothing // matches, the missed value is returned. func FirstOr[T any](in []T, missed T, pred func(t T) bool) T { for _, t := range in {