1
0
mirror of https://github.com/charlienet/go-mixed.git synced 2025-07-18 08:32:40 +08:00

fix log output

This commit is contained in:
2022-06-17 15:25:35 +08:00
parent d12c947226
commit 1eeed34adf
7 changed files with 48 additions and 4 deletions

11
dateconv/duration.go Normal file
View File

@ -0,0 +1,11 @@
package dateconv
import "time"
func ParseDuration(s string) (time.Duration, error) {
if len(s) == 0 {
return time.Duration(0), nil
}
return time.ParseDuration(s)
}

10
dateconv/duration_test.go Normal file
View File

@ -0,0 +1,10 @@
package dateconv
import (
"testing"
)
func TestParseDuration(t *testing.T) {
t.Log(ParseDuration(""))
t.Log(ParseDuration("abc"))
}