Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

encoding/xml: API cleanup #2626

Closed
kylelemons opened this issue Dec 28, 2011 · 7 comments
Closed

encoding/xml: API cleanup #2626

kylelemons opened this issue Dec 28, 2011 · 7 comments
Milestone

Comments

@kylelemons
Copy link
Contributor

Along with the field tag cleanup, it seems like encoding/xml might also want to
structure its API the same way that encoding/gob and encoding/json have before Go 1
comes out, so that we're not stuck with the current API.

In particular:

package xml

func Marshal(v interface{}) ([]byte, error)
func Indent(w io.WriteStringer, src []byte, pfx, ind string)
func Unmarshal(data []byte, v interface{}) error

type Decoder struct {
    // contains filtered or unexported fields
}
func NewDecoder(r io.Reader) *Decoder
func (dec *Decoder) Decode(v interface{}) error

type Encoder struct {
    // contains filtered or unexported fields
}
func NewEncoder(w io.Writer) *Encoder
func (*Encoder) Encode
func (enc *Encoder) Encode(v interface{}) error

type Marshaler interface {
    MarshalXML() ([]byte, error)
}

type Unmarshaler interface {
    UnmarshalXML([]byte) (error)
}
@adg
Copy link
Contributor

adg commented Jan 4, 2012

Comment 1:

I agree this would be a good idea. Requires the appropriate gofix module.

Labels changed: added priority-go1, removed priority-triage.

Status changed to HelpWanted.

@robpike
Copy link
Contributor

robpike commented Jan 13, 2012

Comment 2:

Owner changed to builder@golang.org.

@robpike
Copy link
Contributor

robpike commented Jan 20, 2012

Comment 3:

Issue #2725 has been merged into this issue.

@niemeyer
Copy link
Contributor

Comment 4:

Can we open an exception on the API freeze for this one? I was still hoping to get this
done for Go 1, as it'll bring consistency with the other encoding packages such as json,
gob, etc.
I can get that ready for review for Monday.

@rsc
Copy link
Contributor

rsc commented Jan 20, 2012

Comment 5:

I am willing to consider xml as still in flux
given that major changes landed just last week,
but please get the CL to us soon.  Thanks.

@niemeyer
Copy link
Contributor

Comment 6:

Thanks, will do.

Owner changed to @niemeyer.

Status changed to Accepted.

@niemeyer
Copy link
Contributor

Comment 7:

This issue was closed by revision 0442087.

Status changed to Fixed.

@mikioh mikioh changed the title xml: API cleanup encosing/xml: API cleanup Jan 9, 2015
@mikioh mikioh changed the title encosing/xml: API cleanup encoding/xml: API cleanup Feb 26, 2015
@rsc rsc added this to the Go1 milestone Apr 10, 2015
@rsc rsc removed the priority-go1 label Apr 10, 2015
@golang golang locked and limited conversation to collaborators Jun 24, 2016
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants