FAQ
We seem to be inconsistent with what a "tag" is with regard to a struct.

https://golang.org/doc/go1compat says "Code that uses untagged struct
literals (such as pkg.T{3, "x"}) to create values of these types would fail
to compile after such a change. "

But https://golang.org/ref/spec#Struct_types says that a tag is the part in
quotes available for json/proto reflections (e.g. `json:"foo,omitempty"`)

Which is it?

If both, I propose we rename one.

--
You received this message because you are subscribed to the Google Groups "golang-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-dev+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Search Discussions

  • Saint Abroad at Oct 4, 2014 at 9:04 pm

    On Saturday, 4 October 2014 19:58:51 UTC+1, Brad Fitzpatrick wrote:
    We seem to be inconsistent with what a "tag" is with regard to a struct.

    https://golang.org/doc/go1compat says "Code that uses untagged struct
    literals (such as pkg.T{3, "x"}) to create values of these types would fail
    to compile after such a change. "
    The spec refers to it as a
    "key": http://golang.org/ref/spec#Composite_literals

    --
    You received this message because you are subscribed to the Google Groups "golang-dev" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-dev+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
  • Gustavo Niemeyer at Oct 5, 2014 at 4:24 pm
    The spec seems pretty consistent about what a tag is. It probably wins.

    gustavo @ http://niemeyer.net
    On Oct 4, 2014 8:58 PM, "Brad Fitzpatrick" wrote:

    We seem to be inconsistent with what a "tag" is with regard to a struct.

    https://golang.org/doc/go1compat says "Code that uses untagged struct
    literals (such as pkg.T{3, "x"}) to create values of these types would fail
    to compile after such a change. "

    But https://golang.org/ref/spec#Struct_types says that a tag is the part
    in quotes available for json/proto reflections (e.g. `json:"foo,omitempty"`)

    Which is it?

    If both, I propose we rename one.

    --
    You received this message because you are subscribed to the Google Groups
    "golang-dev" group.
    To unsubscribe from this group and stop receiving emails from it, send an
    email to golang-dev+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
    --
    You received this message because you are subscribed to the Google Groups "golang-dev" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-dev+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
  • Alan Donovan at Oct 7, 2014 at 3:13 am

    On 5 October 2014 12:24, Gustavo Niemeyer wrote:

    The spec seems pretty consistent about what a tag is. It probably wins.
    I agree with that. The two styles of struct literals should perhaps be
    distinguished using the adjectives "named" and "positional".

    --
    You received this message because you are subscribed to the Google Groups "golang-dev" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-dev+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
  • Rob Pike at Oct 7, 2014 at 4:42 am
    I suggested "keyed".

    -rob


    On Mon, Oct 6, 2014 at 8:13 PM, 'Alan Donovan' via golang-dev
    wrote:
    On 5 October 2014 12:24, Gustavo Niemeyer wrote:

    The spec seems pretty consistent about what a tag is. It probably wins.

    I agree with that. The two styles of struct literals should perhaps be
    distinguished using the adjectives "named" and "positional".

    --
    You received this message because you are subscribed to the Google Groups
    "golang-dev" group.
    To unsubscribe from this group and stop receiving emails from it, send an
    email to golang-dev+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
    --
    You received this message because you are subscribed to the Google Groups "golang-dev" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-dev+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
  • Andrew Gerrand at Oct 7, 2014 at 4:54 am
    "named" is problematic because of the confusion between anonymous and named
    struct types.
    On 7 October 2014 14:13, 'Alan Donovan' via golang-dev wrote:
    On 5 October 2014 12:24, Gustavo Niemeyer wrote:

    The spec seems pretty consistent about what a tag is. It probably wins.
    I agree with that. The two styles of struct literals should perhaps be
    distinguished using the adjectives "named" and "positional".

    --
    You received this message because you are subscribed to the Google Groups
    "golang-dev" group.
    To unsubscribe from this group and stop receiving emails from it, send an
    email to golang-dev+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
    --
    You received this message because you are subscribed to the Google Groups "golang-dev" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-dev+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
  • Rob Pike at Oct 7, 2014 at 5:15 am
    "keyed"
    On Mon, Oct 6, 2014 at 9:53 PM, Andrew Gerrand wrote:
    "named" is problematic because of the confusion between anonymous and named
    struct types.

    On 7 October 2014 14:13, 'Alan Donovan' via golang-dev
    wrote:
    On 5 October 2014 12:24, Gustavo Niemeyer wrote:

    The spec seems pretty consistent about what a tag is. It probably wins.

    I agree with that. The two styles of struct literals should perhaps be
    distinguished using the adjectives "named" and "positional".

    --
    You received this message because you are subscribed to the Google Groups
    "golang-dev" group.
    To unsubscribe from this group and stop receiving emails from it, send an
    email to golang-dev+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.

    --
    You received this message because you are subscribed to the Google Groups
    "golang-dev" group.
    To unsubscribe from this group and stop receiving emails from it, send an
    email to golang-dev+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
    --
    You received this message because you are subscribed to the Google Groups "golang-dev" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-dev+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
  • Andrew Gerrand at Oct 7, 2014 at 5:17 am
    If only there were another word we could use. Anyone have any ideas?
    On 7 October 2014 16:15, Rob Pike wrote:

    "keyed"
    On Mon, Oct 6, 2014 at 9:53 PM, Andrew Gerrand wrote:
    "named" is problematic because of the confusion between anonymous and named
    struct types.

    On 7 October 2014 14:13, 'Alan Donovan' via golang-dev
    wrote:
    On 5 October 2014 12:24, Gustavo Niemeyer wrote:

    The spec seems pretty consistent about what a tag is. It probably wins.

    I agree with that. The two styles of struct literals should perhaps be
    distinguished using the adjectives "named" and "positional".

    --
    You received this message because you are subscribed to the Google
    Groups
    "golang-dev" group.
    To unsubscribe from this group and stop receiving emails from it, send
    an
    email to golang-dev+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.

    --
    You received this message because you are subscribed to the Google Groups
    "golang-dev" group.
    To unsubscribe from this group and stop receiving emails from it, send an
    email to golang-dev+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
    --
    You received this message because you are subscribed to the Google Groups "golang-dev" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-dev+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
  • Andrew Gerrand at Oct 7, 2014 at 5:19 am
    Sent: https://codereview.appspot.com/156730043

    --
    You received this message because you are subscribed to the Google Groups "golang-dev" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-dev+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
  • Rob Pike at Oct 7, 2014 at 5:19 am
    "Barnacled".

    -rob

    On Mon, Oct 6, 2014 at 10:16 PM, Andrew Gerrand wrote:
    If only there were another word we could use. Anyone have any ideas?
    On 7 October 2014 16:15, Rob Pike wrote:

    "keyed"
    On Mon, Oct 6, 2014 at 9:53 PM, Andrew Gerrand wrote:
    "named" is problematic because of the confusion between anonymous and
    named
    struct types.

    On 7 October 2014 14:13, 'Alan Donovan' via golang-dev
    wrote:
    On 5 October 2014 12:24, Gustavo Niemeyer wrote:

    The spec seems pretty consistent about what a tag is. It probably
    wins.

    I agree with that. The two styles of struct literals should perhaps be
    distinguished using the adjectives "named" and "positional".

    --
    You received this message because you are subscribed to the Google
    Groups
    "golang-dev" group.
    To unsubscribe from this group and stop receiving emails from it, send
    an
    email to golang-dev+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.

    --
    You received this message because you are subscribed to the Google
    Groups
    "golang-dev" group.
    To unsubscribe from this group and stop receiving emails from it, send
    an
    email to golang-dev+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
    --
    You received this message because you are subscribed to the Google Groups "golang-dev" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-dev+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
  • Andrew Gerrand at Oct 7, 2014 at 5:22 am
    "encrusted"
    "adorned"
    "bedazzled"
    "rococo"
    On 7 October 2014 16:19, Rob Pike wrote:

    "Barnacled".

    -rob

    On Mon, Oct 6, 2014 at 10:16 PM, Andrew Gerrand wrote:
    If only there were another word we could use. Anyone have any ideas?
    On 7 October 2014 16:15, Rob Pike wrote:

    "keyed"
    On Mon, Oct 6, 2014 at 9:53 PM, Andrew Gerrand wrote:
    "named" is problematic because of the confusion between anonymous and
    named
    struct types.

    On 7 October 2014 14:13, 'Alan Donovan' via golang-dev
    wrote:
    On 5 October 2014 12:24, Gustavo Niemeyer wrote:

    The spec seems pretty consistent about what a tag is. It probably
    wins.

    I agree with that. The two styles of struct literals should perhaps
    be
    distinguished using the adjectives "named" and "positional".

    --
    You received this message because you are subscribed to the Google
    Groups
    "golang-dev" group.
    To unsubscribe from this group and stop receiving emails from it,
    send
    an
    email to golang-dev+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.

    --
    You received this message because you are subscribed to the Google
    Groups
    "golang-dev" group.
    To unsubscribe from this group and stop receiving emails from it, send
    an
    email to golang-dev+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
    --
    You received this message because you are subscribed to the Google Groups "golang-dev" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-dev+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
  • Andrey mirtchovski at Oct 7, 2014 at 5:36 am

    "encrusted"
    "adorned"
    "bedazzled"
    "rococo"
    this is clearly throwing away centuries of programming language research!

    (+1 for "rococo", although I would've accepted "baroque")

    --
    You received this message because you are subscribed to the Google Groups "golang-dev" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-dev+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
  • Dave Cheney at Oct 7, 2014 at 8:34 am
    "Festooned"
    On Tue, Oct 7, 2014 at 4:19 PM, Rob Pike wrote:
    "Barnacled".

    -rob

    On Mon, Oct 6, 2014 at 10:16 PM, Andrew Gerrand wrote:
    If only there were another word we could use. Anyone have any ideas?
    On 7 October 2014 16:15, Rob Pike wrote:

    "keyed"
    On Mon, Oct 6, 2014 at 9:53 PM, Andrew Gerrand wrote:
    "named" is problematic because of the confusion between anonymous and
    named
    struct types.

    On 7 October 2014 14:13, 'Alan Donovan' via golang-dev
    wrote:
    On 5 October 2014 12:24, Gustavo Niemeyer wrote:

    The spec seems pretty consistent about what a tag is. It probably
    wins.

    I agree with that. The two styles of struct literals should perhaps be
    distinguished using the adjectives "named" and "positional".

    --
    You received this message because you are subscribed to the Google
    Groups
    "golang-dev" group.
    To unsubscribe from this group and stop receiving emails from it, send
    an
    email to golang-dev+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.

    --
    You received this message because you are subscribed to the Google
    Groups
    "golang-dev" group.
    To unsubscribe from this group and stop receiving emails from it, send
    an
    email to golang-dev+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
    --
    You received this message because you are subscribed to the Google Groups "golang-dev" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-dev+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
    --
    You received this message because you are subscribed to the Google Groups "golang-dev" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-dev+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
  • Jan Mercl at Oct 7, 2014 at 8:39 am

    On Tue, Oct 7, 2014 at 7:16 AM, Andrew Gerrand wrote:
    If only there were another word we could use. Anyone have any ideas?
    Struct literal w/ {explicit,implicit} field[s| names].

    -j

    --
    You received this message because you are subscribed to the Google Groups "golang-dev" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-dev+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupgolang-dev @
categoriesgo
postedOct 4, '14 at 6:58p
activeOct 7, '14 at 8:39a
posts14
users9
websitegolang.org

People

Translate

site design / logo © 2021 Grokbase