Hey All, I've been using a typedef of
type MaybeTimestamp *int64 so we can JSON encode timestamps correctly, see https://medium.com/coding-and-deploying-in-the-cloud/time-stamps-in-golang-abcaf581b72f for inspriation I was surprised that the following didn't work (see https://play.golang.org/p/1QQylqTLkB): func NewMaybeTimestamp(t time.Time) MaybeTimestamp { return &t.Unix() } // fails with: // tmp/sandbox449672725/main.go:14: cannot take the address of t.Unix() I can fix this by introducing a temporary variable: func NewMaybeTimestamp(t time.Time) MaybeTimestamp { temp := t.Unix() return &temp } Seeing as this is the obvious solution to this problem, I was pretty disappointed that the compiler couldn't insert the temporary for me. Is this something that should change, or is it just a limitation hard-coded by the compatibility guarantee? Conrad -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.