GAE Go模板.Execute,传递一个带有向量的结构体

huangapple go评论91阅读模式
英文:

GAE Go template.Execute, passing a struct with vector

问题

我在Go应用程序中使用struct的vector.Vector来方便地存储一些数据。我想通过template.Execute在Google App Engine网页上显示来自vector的所有数据。这是否可能,我如何访问解析后的HTML文件中的数据?如果我使用数组或切片会更容易吗?

英文:

I'm storing some data in a Go app in a struct's vector.Vector for convenience. I want to display all the data from the vector on Google App Engine webpage through template.Execute. Is it possible and how would I access the data in the parsed html file? Would it be easier if I used an array or slice instead?

答案1

得分: 1

使用切片。

> Go每周快照历史2011-10-18
>
>
> container/vector包已被删除。切片更好:
> 切片技巧

英文:

Use slices.

> Go Weekly Snapshot History 2011-10-18
>
>
> The container/vector package has been deleted. Slices are better:
> SliceTricks.

huangapple
  • 本文由 发表于 2011年12月3日 04:50:53
  • 转载请务必保留本文链接:https://go.coder-hub.com/8362481.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定