mirror of
https://gitee.com/johng/gf
synced 2026-07-08 14:39:50 +08:00
同步主库
This commit is contained in:
@ -6,16 +6,16 @@
|
||||
|
||||
package gparser
|
||||
|
||||
func (p *Parser) ToXml(rootTag...string) ([]byte, error) {
|
||||
return p.json.ToXml(rootTag...)
|
||||
func (p *Parser) ToXml(rootTag ...string) ([]byte, error) {
|
||||
return p.json.ToXml(rootTag...)
|
||||
}
|
||||
|
||||
func (p *Parser) ToXmlIndent(rootTag...string) ([]byte, error) {
|
||||
return p.json.ToXmlIndent(rootTag...)
|
||||
func (p *Parser) ToXmlIndent(rootTag ...string) ([]byte, error) {
|
||||
return p.json.ToXmlIndent(rootTag...)
|
||||
}
|
||||
|
||||
func (p *Parser) ToJson() ([]byte, error) {
|
||||
return p.json.ToJson()
|
||||
return p.json.ToJson()
|
||||
}
|
||||
|
||||
func (p *Parser) ToJsonString() (string, error) {
|
||||
@ -23,7 +23,7 @@ func (p *Parser) ToJsonString() (string, error) {
|
||||
}
|
||||
|
||||
func (p *Parser) ToJsonIndent() ([]byte, error) {
|
||||
return p.json.ToJsonIndent()
|
||||
return p.json.ToJsonIndent()
|
||||
}
|
||||
|
||||
func (p *Parser) ToJsonIndentString() (string, error) {
|
||||
@ -31,23 +31,23 @@ func (p *Parser) ToJsonIndentString() (string, error) {
|
||||
}
|
||||
|
||||
func (p *Parser) ToYaml() ([]byte, error) {
|
||||
return p.json.ToYaml()
|
||||
return p.json.ToYaml()
|
||||
}
|
||||
|
||||
func (p *Parser) ToToml() ([]byte, error) {
|
||||
return p.json.ToToml()
|
||||
return p.json.ToToml()
|
||||
}
|
||||
|
||||
func VarToXml(value interface{}, rootTag...string) ([]byte, error) {
|
||||
return New(value).ToXml(rootTag...)
|
||||
func VarToXml(value interface{}, rootTag ...string) ([]byte, error) {
|
||||
return New(value).ToXml(rootTag...)
|
||||
}
|
||||
|
||||
func VarToXmlIndent(value interface{}, rootTag...string) ([]byte, error) {
|
||||
return New(value).ToXmlIndent(rootTag...)
|
||||
func VarToXmlIndent(value interface{}, rootTag ...string) ([]byte, error) {
|
||||
return New(value).ToXmlIndent(rootTag...)
|
||||
}
|
||||
|
||||
func VarToJson(value interface{}) ([]byte, error) {
|
||||
return New(value).ToJson()
|
||||
return New(value).ToJson()
|
||||
}
|
||||
|
||||
func VarToJsonString(value interface{}) (string, error) {
|
||||
@ -63,14 +63,13 @@ func VarToJsonIndentString(value interface{}) (string, error) {
|
||||
}
|
||||
|
||||
func VarToYaml(value interface{}) ([]byte, error) {
|
||||
return New(value).ToYaml()
|
||||
return New(value).ToYaml()
|
||||
}
|
||||
|
||||
func VarToToml(value interface{}) ([]byte, error) {
|
||||
return New(value).ToToml()
|
||||
return New(value).ToToml()
|
||||
}
|
||||
|
||||
func VarToStruct(value interface{}, obj interface{}) error {
|
||||
return New(value).ToStruct(obj)
|
||||
return New(value).ToStruct(obj)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user