mirror of
https://github.com/yusing/godoxy.git
synced 2026-04-27 02:38:33 +02:00
refactor: move mock time to utils
This commit is contained in:
@@ -10,6 +10,7 @@ import (
|
||||
|
||||
. "github.com/yusing/go-proxy/internal/net/gphttp/accesslog"
|
||||
"github.com/yusing/go-proxy/internal/task"
|
||||
"github.com/yusing/go-proxy/internal/utils"
|
||||
expect "github.com/yusing/go-proxy/internal/utils/testing"
|
||||
)
|
||||
|
||||
@@ -56,7 +57,7 @@ func fmtLog(cfg *Config) (ts string, line string) {
|
||||
|
||||
t := time.Now()
|
||||
logger := NewMockAccessLogger(testTask, cfg)
|
||||
MockTimeNow(t)
|
||||
utils.MockTimeNow(t)
|
||||
buf = logger.AppendLog(buf, req, resp)
|
||||
return t.Format(LogTimeFormat), string(buf)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user