mirror of
https://github.com/docker/docs.git
synced 2026-03-29 15:28:51 +07:00
Move timeutils functions to the only places where they are used.
- Move time json marshaling to the jsonlog package: this is a docker internal hack that we should not promote as a library. - Move Timestamp encoding/decoding functions to the API types: This is only used there. It could be a standalone library but I don't this it's worth having a separated repo for this. It could introduce more complexity than it solves. Signed-off-by: David Calavera <david.calavera@gmail.com>
This commit is contained in:
@@ -11,7 +11,7 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/docker/docker/pkg/integration/checker"
|
||||
"github.com/docker/docker/pkg/timeutils"
|
||||
"github.com/docker/docker/pkg/jsonlog"
|
||||
"github.com/go-check/check"
|
||||
)
|
||||
|
||||
@@ -75,7 +75,7 @@ func (s *DockerSuite) TestLogsTimestamps(c *check.C) {
|
||||
|
||||
for _, l := range lines {
|
||||
if l != "" {
|
||||
_, err := time.Parse(timeutils.RFC3339NanoFixed+" ", ts.FindString(l))
|
||||
_, err := time.Parse(jsonlog.RFC3339NanoFixed+" ", ts.FindString(l))
|
||||
c.Assert(err, checker.IsNil, check.Commentf("Failed to parse timestamp from %v", l))
|
||||
// ensure we have padded 0's
|
||||
c.Assert(l[29], checker.Equals, uint8('Z'))
|
||||
|
||||
Reference in New Issue
Block a user