diff --git a/main.go b/main.go index b05b9d8..733f4a2 100644 --- a/main.go +++ b/main.go @@ -26,13 +26,15 @@ func getArgsStartTime() time.Time { flag.Parse() date := flag.Arg(0) if date == "" { - // log.Println(flag.) + log.Println("args", flag.Args()) panic("please input date eg. '2020-11-30 16:29:17'") } - start, err := time.ParseInLocation("2006-01-02 15:04:03", date, time.Local) + + start, err := time.ParseInLocation("2006-01-02 15:04:05", date, time.Local) if err != nil { panic(err) } + return start } diff --git a/main_test.go b/main_test.go new file mode 100644 index 0000000..ef64976 --- /dev/null +++ b/main_test.go @@ -0,0 +1,7 @@ +package main + +import "testing" + +func TestMain(t *testing.T) { + main() +}