Skip to content

Commit

Permalink
logtime
Browse files Browse the repository at this point in the history
  • Loading branch information
Songmu committed Jul 13, 2016
1 parent 401aa23 commit 15982a6
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions example_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
)

type log struct {
Time LogTime
Time logTime
Host net.IP
Req string
Status int
Expand All @@ -22,11 +22,11 @@ type log struct {

const timeFormat = "2006-01-02T15:04:05Z07:00"

type LogTime struct {
type logTime struct {
time.Time
}

func (lt *LogTime) UnmarshalText(t []byte) error {
func (lt *logTime) UnmarshalText(t []byte) error {
ti, err := time.ParseInLocation(timeFormat, string(t), time.UTC)
if err != nil {
return err
Expand All @@ -49,7 +49,7 @@ func ExampleUnmarshal() {
pretty.Println(l)
// Output:
// ltsv_test.log{
// Time: ltsv_test.LogTime{
// Time: ltsv_test.logTime{
// Time: time.Time{
// sec: 63603932404,
// nsec: 0,
Expand Down

0 comments on commit 15982a6

Please sign in to comment.