Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

time: MarshalBinary and UnmarshalBinary isn't symmetrical #15716

Closed
bep opened this issue May 17, 2016 · 3 comments

Comments

Projects
None yet
5 participants
@bep
Copy link
Contributor

commented May 17, 2016

See https://play.golang.org/p/q9ddVAqibt

package main

import (
    "fmt"
    "time"
)

func main() {
    var t0 time.Time
    b, _ := t0.MarshalBinary()

    var t time.Time
    t.UnmarshalBinary(b)

    fmt.Printf("%#v %#v\n", t0, t)
}

Prints:

time.Time{sec:0, nsec:0, loc:(*time.Location)(nil)} time.Time{sec:0, nsec:0, loc:(*time.Location)(0x1e2100)}

Expected the time instances to be equal.

@gopherbot

This comment has been minimized.

Copy link

commented Oct 17, 2016

CL https://golang.org/cl/31144 mentions this issue.

@gopherbot gopherbot closed this in 5fbf35d Oct 18, 2016

@dolmen

This comment has been minimized.

Copy link

commented Feb 24, 2017

This fix is not mentioned in Go 1.8 release notes. :(
Is it the right place to report this issue with the release notes, or should I open another issue?

@bradfitz

This comment has been minimized.

Copy link
Member

commented Feb 24, 2017

There are hundreds of minor bug fixes not mentioned in the release notes.

But yes, opening a new bug is the way to enact change if you think we accidentally omitted this (likely) and this is user-visible enough to warrant a mention. We don't track closed issues.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.