Skip to content

Commit

Permalink
Merge pull request #185 from anthonyfok/complete-test-for-datetime-wi…
Browse files Browse the repository at this point in the history
…th-offset

Complete the testing for decoding datetime with UTC offset
  • Loading branch information
BurntSushi committed Jun 26, 2017
2 parents 8b58b60 + afe6997 commit a368813
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions decode_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ age = 250
andrew = "gallant"
kait = "brady"
now = 1987-07-05T05:45:00Z
nowCanada = 2017-06-22T02:14:36-06:00
nowChina = 2017-06-22T16:15:21+08:00
nowEast = 2017-06-22T16:15:21+08:00
nowWest = 2017-06-22T02:14:36-06:00
yesOrNo = true
pi = 3.14
colors = [
Expand All @@ -40,6 +40,8 @@ cauchy = "cat 2"
Pi float64
YesOrNo bool
Now time.Time
NowEast time.Time
NowWest time.Time
Andrew string
Kait string
My map[string]cats
Expand All @@ -55,11 +57,21 @@ cauchy = "cat 2"
if err != nil {
panic(err)
}
nowEast, err := time.Parse("2006-01-02T15:04:05-07:00", "2017-06-22T16:15:21+08:00")
if err != nil {
panic(err)
}
nowWest, err := time.Parse("2006-01-02T15:04:05-07:00", "2017-06-22T02:14:36-06:00")
if err != nil {
panic(err)
}
var answer = simple{
Age: 250,
Andrew: "gallant",
Kait: "brady",
Now: now,
NowEast: nowEast,
NowWest: nowWest,
YesOrNo: true,
Pi: 3.14,
Colors: [][]string{
Expand Down

0 comments on commit a368813

Please sign in to comment.