1
0
mirror of https://github.com/golang/go synced 2024-10-05 00:21:21 -06:00
go/src/pkg/encoding/xml
Russ Cox 6e3e380923 allow direct conversion between string and named []byte, []rune
The allowed conversions before and after are:
        type Tstring string
        type Tbyte []byte
        type Trune []rune

        string <-> string  // ok
        string <-> []byte  // ok
        string <-> []rune // ok
        string <-> Tstring // ok
        string <-> Tbyte // was illegal, now ok
        string <-> Trune // was illegal, now ok

        Tstring <-> string  // ok
        Tstring <-> []byte  // ok
        Tstring <-> []rune // ok
        Tstring <-> Tstring // ok
        Tstring <-> Tbyte // was illegal, now ok
        Tstring <-> Trune // was illegal, now ok

Update spec, compiler, tests.  Use in a few packages.

We agreed on this a few months ago but never implemented it.

Fixes #1707.

R=golang-dev, gri, r
CC=golang-dev
https://golang.org/cl/5421057
2011-11-22 12:30:02 -05:00
..
atom_test.go encoding: move asn1, csv, gob, json, xml into encoding 2011-11-03 11:39:52 -07:00
embed_test.go encoding: move asn1, csv, gob, json, xml into encoding 2011-11-03 11:39:52 -07:00
Makefile renaming_1: hand-edited files for go 1 renaming 2011-11-08 15:38:47 -08:00
marshal_test.go encoding: move asn1, csv, gob, json, xml into encoding 2011-11-03 11:39:52 -07:00
marshal.go encoding: move asn1, csv, gob, json, xml into encoding 2011-11-03 11:39:52 -07:00
read_test.go xml: allow parsing of <_> </_>. 2011-11-07 10:47:44 -05:00
read.go renaming_2: gofix -r go1pkgrename src/pkg/[a-l]* 2011-11-08 15:40:58 -08:00
xml_test.go allow direct conversion between string and named []byte, []rune 2011-11-22 12:30:02 -05:00
xml.go renaming_2: gofix -r go1pkgrename src/pkg/[a-l]* 2011-11-08 15:40:58 -08:00