add more unit testing case
package main
-import (
- "fmt"
- "github.com/gogf/gf/encoding/gparser"
-)
+import "github.com/gogf/gf/debug/gdebug"
-type User struct {
- Name string `xml:"name" json:"name"`
- Age int `xml:"bb" json:"dd" gconv:"aa"`
- Addr string `xml:"cc"`
+func Test() {
+ gdebug.PrintStack()
}
func main() {
- user := User{
- Name: "sss",
- Age: 22,
- Addr: "kaldsj",
- }
-
- xmlStr, err := gparser.VarToXmlIndent(user, "user")
- if err != nil {
- fmt.Println(err)
- return
- }
-
- fmt.Println(string(xmlStr))
+ Test()
}
