()
| 91 | } |
| 92 | |
| 93 | func ExampleAddDaySafe() { |
| 94 | leapYearDate1, _ := time.Parse("2006-01-02", "2024-02-29") |
| 95 | result1 := AddDaySafe(leapYearDate1, 1) |
| 96 | |
| 97 | leapYearDate2, _ := time.Parse("2006-01-02", "2024-03-01") |
| 98 | result2 := AddDaySafe(leapYearDate2, -1) |
| 99 | |
| 100 | nonLeapYearDate1, _ := time.Parse("2006-01-02", "2025-02-28") |
| 101 | result3 := AddDaySafe(nonLeapYearDate1, 1) |
| 102 | |
| 103 | nonLeaYearDate2, _ := time.Parse("2006-01-02", "2025-03-01") |
| 104 | result4 := AddDaySafe(nonLeaYearDate2, -1) |
| 105 | |
| 106 | fmt.Println(result1.Format("2006-01-02")) |
| 107 | fmt.Println(result2.Format("2006-01-02")) |
| 108 | fmt.Println(result3.Format("2006-01-02")) |
| 109 | fmt.Println(result4.Format("2006-01-02")) |
| 110 | |
| 111 | // Output: |
| 112 | // 2024-03-01 |
| 113 | // 2024-02-29 |
| 114 | // 2025-03-01 |
| 115 | // 2025-02-28 |
| 116 | } |
| 117 | |
| 118 | func ExampleAddMonthSafe() { |
| 119 | date1, _ := time.Parse("2006-01-02", "2025-01-31") |
nothing calls this directly
no test coverage detected
searching dependent graphs…