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

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

text/html 模板包中的“范圍”操作和“管道”說明。

text/html 模板包中的“范圍”操作和“管道”說明。

Go
慕容3067478 2021-09-10 21:19:09
我嘗試在 text/html 模板包中獲得一些優(yōu)點。我已經(jīng)從 golang 站點閱讀了它的文檔。很難理解 . (點)在一般情況下,在一定的時間范圍內(nèi)動作?!肮艿馈本烤故鞘裁匆馑?,可能因為我的英語不是母語而難以理解):{{pipeline}}The default textual representation of the value of the pipelineis copied to the output.讓我們考慮一個例子:    data := map[string]interface{}{        "struct": &Order{            ID:     1,            CustID: 2,            Total:  3.65,            Name: "Something",        },        "name1":  "Timur",        "name2": "Renat",    }    t.ExecuteTemplate(rw, "index", data)這是“索引”:{{define "index"}}    {{range $x := .}}        {{.}}        <b>{{$x}}</b><br>        <i>{{$.struct.ID}}</i><br>        <br>        # the lines below don't work and break the loop        # {{.ID}}        # or        # {{.struct.ID}}        # what if I want here another range loop that handles "struct" members        # when I reach "struct" field in the data variable or just do nothing        # and just continue the loop?     {{end}}{{end}}輸出:帖木兒帖木兒1長Renat長Renat1{1 2 3.65 某事}{1 2 3.65 某事}1
查看完整描述

1 回答

  • 1 回答
  • 0 關(guān)注
  • 179 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

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

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學習伙伴

公眾號

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