第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問題,去搜搜看,總會(huì)有你想問的

golang XML 未解組

golang XML 未解組

Go
慕田峪9158850 2021-06-13 12:33:07
我有以下 XML:<wb:sources page="1" pages="1" per_page="50" total="28" xmlns:wb="http://www.worldbank.org">  <wb:source id="11">    <wb:name>Africa Development Indicators</wb:name>    <wb:description />    <wb:url />  </wb:source>  <wb:source id="31">    <wb:name>Country Policy and Institutional Assessment (CPIA) </wb:name>    <wb:description />    <wb:url />  </wb:source></wb:sources>我解析 XML 的代碼:     type Source struct {    Id   string `xml:"id,attr"`    Name string `xml"wb:name"`}type Sources struct {    XMLName xml.Name `xml"wb:sources"`    Sourcez []Source `xml"wb:source"`}    func GetSources() (*Sources, error) {        resp, err := http.Get(sourcesUrl)        if err != nil {            log.Fatalf("error %v", err)            return nil, err        }        defer resp.Body.Close()        s := new(Sources)        body, err := ioutil.ReadAll(resp.Body)        if err != nil {            log.Print(err)            return nil, err        }        log.Printf("body %v", string(body))        xml.Unmarshal(body, &s)        return s, nil    }My code:    sources, err := GetSources()        if err != nil {            log.Panic()        }        fmt.Printf("%v ", sources)繼續(xù)返回&{{http://www.worldbank.org sources} []}我做錯(cuò)了什么?
查看完整描述

2 回答

  • 2 回答
  • 0 關(guān)注
  • 223 瀏覽

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)