FAQ
Code: http://play.golang.org/p/_HOwkVnJ5o

The code has different behavior between go1.0.3 and go1.1:

$ gvm use go1.0.3
Now using version go1.0.3
$ go run test.go
{"data":"abc"} <nil>

$ gvm use go1.1
Now using version go1.1
$ go run test.go
{} <nil>

Is it changed by design or a bug?

--
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+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Search Discussions

  • StalkR at May 28, 2013 at 9:12 am
    I would say by design?
    https://code.google.com/p/go/source/browse/src/pkg/encoding/json/encode.go?name=go1.1#95
    [...] Otherwise there are multiple fields, and all are ignored; no error occurs.

    In this case it is enforced by:
    https://code.google.com/p/go/source/browse/src/pkg/encoding/json/encode.go?name=go1.1#725
    // Multiple tagged fields at the same level: conflict.
    // Return no field.

    In 1.0.3 conflicts were not handled (if j.I were not empty, json would
    contain two data keys).
    On Tue, May 28, 2013 at 8:58 AM, Googol Lee wrote:
    Code: http://play.golang.org/p/_HOwkVnJ5o

    The code has different behavior between go1.0.3 and go1.1:

    $ gvm use go1.0.3
    Now using version go1.0.3
    $ go run test.go
    {"data":"abc"} <nil>

    $ gvm use go1.1
    Now using version go1.1
    $ go run test.go
    {} <nil>

    Is it changed by design or a bug?

    --
    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+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
    --
    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+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Googol Lee at May 28, 2013 at 9:16 am
    Thanks.
    On Tuesday, May 28, 2013 5:12:23 PM UTC+8, StalkR wrote:

    I would say by design?

    https://code.google.com/p/go/source/browse/src/pkg/encoding/json/encode.go?name=go1.1#95
    [...] Otherwise there are multiple fields, and all are ignored; no error
    occurs.

    In this case it is enforced by:

    https://code.google.com/p/go/source/browse/src/pkg/encoding/json/encode.go?name=go1.1#725
    // Multiple tagged fields at the same level: conflict.
    // Return no field.

    In 1.0.3 conflicts were not handled (if j.I were not empty, json would
    contain two data keys).
    On Tue, May 28, 2013 at 8:58 AM, Googol Lee wrote:
    Code: http://play.golang.org/p/_HOwkVnJ5o

    The code has different behavior between go1.0.3 and go1.1:

    $ gvm use go1.0.3
    Now using version go1.0.3
    $ go run test.go
    {"data":"abc"} <nil>

    $ gvm use go1.1
    Now using version go1.1
    $ go run test.go
    {} <nil>

    Is it changed by design or a bug?

    --
    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...@googlegroups.com <javascript:>.
    For more options, visit https://groups.google.com/groups/opt_out.
    --
    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+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupgolang-nuts @
categoriesgo
postedMay 28, '13 at 6:58a
activeMay 28, '13 at 9:16a
posts3
users2
websitegolang.org

2 users in discussion

Googol Lee: 2 posts StalkR: 1 post

People

Translate

site design / logo © 2021 Grokbase