1
0
mirror of https://github.com/duke-git/lancet.git synced 2026-02-04 12:52:28 +08:00

doc: add go playground demo

This commit is contained in:
dudaodong
2023-05-19 11:42:17 +08:00
parent 78aa679670
commit 259dbce85e
13 changed files with 48 additions and 29 deletions

View File

@@ -73,7 +73,7 @@ func AddDay(t time.Time, day int64) time.Time {
}
// AddYear add or sub year to the time.
// Play: todo
// Play: https://go.dev/play/p/MqW2ujnBx10
func AddYear(t time.Time, year int64) time.Time {
return t.Add(365 * 24 * time.Hour * time.Duration(year))
}
@@ -226,7 +226,7 @@ func EndOfYear(t time.Time) time.Time {
}
// IsLeapYear check if param year is leap year or not.
// Play: todo
// Play: https://go.dev/play/p/xS1eS2ejGew
func IsLeapYear(year int) bool {
return year%4 == 0 && (year%100 != 0 || year%400 == 0)
}