mirror of
https://github.com/duke-git/lancet.git
synced 2026-03-01 00:35:28 +08:00
release v1.2.7
This commit is contained in:
@@ -4,7 +4,7 @@
|
|||||||
<br/>
|
<br/>
|
||||||
|
|
||||||

|

|
||||||
[](https://github.com/duke-git/lancet/releases)
|
[](https://github.com/duke-git/lancet/releases)
|
||||||
[](https://pkg.go.dev/github.com/duke-git/lancet/v2)
|
[](https://pkg.go.dev/github.com/duke-git/lancet/v2)
|
||||||
[](https://goreportcard.com/report/github.com/duke-git/lancet/v2)
|
[](https://goreportcard.com/report/github.com/duke-git/lancet/v2)
|
||||||
[](https://github.com/duke-git/lancet/actions/workflows/codecov.yml)
|
[](https://github.com/duke-git/lancet/actions/workflows/codecov.yml)
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
<br/>
|
<br/>
|
||||||
|
|
||||||

|

|
||||||
[](https://github.com/duke-git/lancet/releases)
|
[](https://github.com/duke-git/lancet/releases)
|
||||||
[](https://pkg.go.dev/github.com/duke-git/lancet/v2)
|
[](https://pkg.go.dev/github.com/duke-git/lancet/v2)
|
||||||
[](https://goreportcard.com/report/github.com/duke-git/lancet/v2)
|
[](https://goreportcard.com/report/github.com/duke-git/lancet/v2)
|
||||||
[](https://github.com/duke-git/lancet/actions/workflows/codecov.yml)
|
[](https://github.com/duke-git/lancet/actions/workflows/codecov.yml)
|
||||||
|
|||||||
@@ -19,10 +19,10 @@ func TestToUnix(t *testing.T) {
|
|||||||
func TestToFormat(t *testing.T) {
|
func TestToFormat(t *testing.T) {
|
||||||
assert := internal.NewAssert(t, "TestToFormat")
|
assert := internal.NewAssert(t, "TestToFormat")
|
||||||
|
|
||||||
tm, err := NewFormat("2022/03/18 17:04:05")
|
_, err := NewFormat("2022/03/18 17:04:05")
|
||||||
assert.IsNotNil(err)
|
assert.IsNotNil(err)
|
||||||
|
|
||||||
tm, err = NewFormat("2022-03-18 17:04:05")
|
tm, err := NewFormat("2022-03-18 17:04:05")
|
||||||
assert.IsNil(err)
|
assert.IsNil(err)
|
||||||
|
|
||||||
t.Log("ToFormat -> ", tm.ToFormat())
|
t.Log("ToFormat -> ", tm.ToFormat())
|
||||||
@@ -31,23 +31,22 @@ func TestToFormat(t *testing.T) {
|
|||||||
func TestToFormatForTpl(t *testing.T) {
|
func TestToFormatForTpl(t *testing.T) {
|
||||||
assert := internal.NewAssert(t, "TestToFormatForTpl")
|
assert := internal.NewAssert(t, "TestToFormatForTpl")
|
||||||
|
|
||||||
tm, err := NewFormat("2022/03/18 17:04:05")
|
_, err := NewFormat("2022/03/18 17:04:05")
|
||||||
assert.IsNotNil(err)
|
assert.IsNotNil(err)
|
||||||
|
|
||||||
tm, err = NewFormat("2022-03-18 17:04:05")
|
tm, err := NewFormat("2022-03-18 17:04:05")
|
||||||
assert.IsNil(err)
|
assert.IsNil(err)
|
||||||
|
|
||||||
t.Log("ToFormatForTpl -> ", tm.ToFormatForTpl("2006/01/02 15:04:05"))
|
t.Log("ToFormatForTpl -> ", tm.ToFormatForTpl("2006/01/02 15:04:05"))
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestToIso8601(t *testing.T) {
|
func TestToIso8601(t *testing.T) {
|
||||||
assert := internal.NewAssert(t, "TestToIso8601")
|
assert := internal.NewAssert(t, "TestToIso8601")
|
||||||
|
|
||||||
tm, err := NewISO8601("2022-03-18 17:04:05")
|
_, err := NewISO8601("2022-03-18 17:04:05")
|
||||||
assert.IsNotNil(err)
|
assert.IsNotNil(err)
|
||||||
|
|
||||||
tm, err = NewISO8601("2006-01-02T15:04:05.999Z")
|
tm, err := NewISO8601("2006-01-02T15:04:05.999Z")
|
||||||
assert.IsNil(err)
|
assert.IsNil(err)
|
||||||
|
|
||||||
t.Log("ToIso8601 -> ", tm.ToIso8601())
|
t.Log("ToIso8601 -> ", tm.ToIso8601())
|
||||||
|
|||||||
Reference in New Issue
Block a user