• Russ Cox's avatar
    reflect: support for struct tag use by multiple packages · 25733a94
    Russ Cox authored
    Each package using struct field tags assumes that
    it is the only package storing data in the tag.
    This CL adds support in package reflect for sharing
    tags between multiple packages.  In this scheme, the
    tags must be of the form
    
            key:"value" key2:"value2"
    
    (raw strings help when writing that tag in Go source).
    
    reflect.StructField's Tag field now has type StructTag
    (a string type), which has method Get(key string) string
    that returns the associated value.
    
    Clients of json and xml will need to be updated.
    Code that says
    
            type T struct {
                    X int "name"
            }
    
    should become
    
            type T struct {
                    X int `json:"name"`  // or `xml:"name"`
            }
    
    Use govet to identify struct tags that need to be changed
    to use the new syntax.
    
    R=r, r, dsymonds, bradfitz, kevlar, fvbommel, n13m3y3r
    CC=golang-dev
    https://golang.org/cl/4645069
    25733a94
Name
Last commit
Last update
..
cmd Loading commit data...
lib9 Loading commit data...
libbio Loading commit data...
libmach Loading commit data...
pkg Loading commit data...
Make.ccmd Loading commit data...
Make.clib Loading commit data...
Make.cmd Loading commit data...
Make.common Loading commit data...
Make.inc Loading commit data...
Make.pkg Loading commit data...
all-qemu.bash Loading commit data...
all.bash Loading commit data...
clean.bash Loading commit data...
env.bash Loading commit data...
make.bash Loading commit data...
quietgcc.bash Loading commit data...
run.bash Loading commit data...
sudo.bash Loading commit data...
version.bash Loading commit data...