Skip to content

Commit

Permalink
update mod
Browse files Browse the repository at this point in the history
  • Loading branch information
iGoogle-ink committed Nov 24, 2023
1 parent 434c22e commit ff5cb40
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 28 deletions.
7 changes: 0 additions & 7 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
module github.com/go-pay/xtime

go 1.20

require github.com/go-pay/xlog v0.0.1

require (
go.uber.org/multierr v1.11.0 // indirect
go.uber.org/zap v1.26.0 // indirect
)
11 changes: 0 additions & 11 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,11 +0,0 @@
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/go-pay/xlog v0.0.1 h1:hbOHN+Rn6pH83JQzk6904fL7fsHsr9iKCZoBVX+tF9Y=
github.com/go-pay/xlog v0.0.1/go.mod h1:RgjidhvsA+4Qwpk9wN8U9zb/R3Wq+HtaAO0xUXdmSdo=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk=
go.uber.org/goleak v1.2.0 h1:xqgm/S+aQvhWFTtR0XK3Jvg7z8kGV8P4X14IzwN3Eqk=
go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0=
go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y=
go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo=
go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
19 changes: 9 additions & 10 deletions xtime_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,17 @@ package xtime

import (
"encoding/json"
"log"
"testing"
"time"

"github.com/go-pay/xlog"
)

func TestXtime(t *testing.T) {
minutes := Time(1609066441).Time().Add(time.Minute * 30).Sub(time.Now()).Minutes()
xlog.Debug(minutes)
log.Println(minutes)
if minutes < 0 { // 30分钟超时
//更新订单状态为订单超时
xlog.Debug("超时")
log.Println("超时")
}
}

Expand All @@ -35,14 +34,14 @@ func TestParseTime(t *testing.T) {
tp := new(TimeParser)
err := json.Unmarshal([]byte(parseText), tp)
if err != nil {
xlog.Error(err)
log.Println(err)
return
}

xlog.Infof("%+v", tp)
log.Printf("%+v", tp)

xlog.Debugf("t1: %s", tp.T1.UnitTime())
xlog.Debugf("t2: %s", tp.T2.UnitTime())
xlog.Debugf("t3: %s", tp.T3.UnitTime())
xlog.Debugf("t4: %s", tp.T4.UnitTime())
log.Printf("t1: %s", tp.T1.UnitTime())
log.Printf("t2: %s", tp.T2.UnitTime())
log.Printf("t3: %s", tp.T3.UnitTime())
log.Printf("t4: %s", tp.T4.UnitTime())
}

0 comments on commit ff5cb40

Please sign in to comment.