📝 fix incorrect function comments (#16719)

This commit is contained in:
Jeffrey Chen 2025-12-29 15:52:01 +08:00 committed by GitHub
parent f7822b5b3e
commit 4132736037
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 3 additions and 3 deletions

View file

@ -63,7 +63,7 @@ func RandString(length int) string {
return string(b)
}
// InsertElem inserts value at index into a.
// InsertElem inserts value at index into s.
// 0 <= index <= len(s)
func InsertElem[T any](s []T, index int, value T) []T {
if len(s) == index { // nil or empty slice or after last element

View file

@ -59,7 +59,7 @@ func WeekdayCN2(date time.Time) string {
return weekdayCN2[week]
}
// ISOWeek returns the ISO 8601 year and week number in which date occurs.
// ISOWeek returns the ISO 8601 week number in which date occurs.
// Week ranges from 1 to 53. Jan 01 to Jan 03 of year n might belong to week 52 or 53 of year n-1,
// and Dec 29 to Dec 31 might belong to week 1 of year n+1.
func ISOWeek(date time.Time) int {
@ -73,7 +73,7 @@ func ISOYear(date time.Time) int {
return year
}
// ISOMonth returns the month in which the first day of the ISO 8601 week of date occurs.
// ISOMonth returns the month in which the Thursday of the ISO 8601 week of date occurs.
func ISOMonth(date time.Time) int {
isoYear, isoWeek := date.ISOWeek()