golang解析xml的方法

2020-01-28 11:52:20刘景俊

                // fmt.Printf("%s,%s,%s,%sn", countryRegion.Code, state.Code, city.Code, city.Name)
                if len(city.Region) == 0 {
                    continue
                }
                for _, region := range city.Region {
                    fmt.Printf("%s,%s,%s,%s,%sn", countryRegion.Code, state.Code, city.Code, region.Code, region.Name)
                }
            }
        }
    }
    // // json
    // js, err := json.Marshal(&v.CountryRegion[0])
    // if err != nil {
    //  panic(err)
    // }
    // fmt.Printf("%sn", js)
}

希望本文所述对大家Go语言程序设计有所帮助。