From 149e6a2149aedc3b27f049d5940d2727f01a8395 Mon Sep 17 00:00:00 2001 From: kercylan98 Date: Wed, 20 Sep 2023 17:21:16 +0800 Subject: [PATCH] =?UTF-8?q?test:=20=E6=96=B0=E5=A2=9E=20times.CalcNextSecW?= =?UTF-8?q?ithTime=20=E7=A4=BA=E4=BE=8B=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- utils/times/calc_example_test.go | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 utils/times/calc_example_test.go diff --git a/utils/times/calc_example_test.go b/utils/times/calc_example_test.go new file mode 100644 index 0000000..a9b79cd --- /dev/null +++ b/utils/times/calc_example_test.go @@ -0,0 +1,15 @@ +package times_test + +import ( + "fmt" + "github.com/kercylan98/minotaur/utils/times" + "time" +) + +func ExampleCalcNextSecWithTime() { + now := time.Date(2023, 9, 20, 0, 0, 3, 0, time.Local) + fmt.Println(times.CalcNextSecWithTime(now, 10)) + + // Output: + // 7 +}