我一直在使用DuckDuckGo的Go 庫,除了一件事外,它一直運行良好。在“相關主題”部分。通常,它看起來像這樣:{"RelatedTopics" : [ { "Result" : "<a href=\"http://duckduckgo.com/Criticism_of_Google\">Criticism of Google</a> - Criticism of Google includes possible misuse and manipulation of search results, its use of others' intellectual property, concerns that its compilation of data may violate people's privacy, cen...", "Icon" : { "URL" : "", "Height" : "", "Width" : "" }, "FirstURL" : "http://duckduckgo.com/Criticism_of_Google", "Text" : "Criticism of Google - Criticism of Google includes possible misuse and manipulation of search results, its use of others' intellectual property, concerns that its compilation of data may violate people's privacy, cen..." }, { "Result" : "<a href=\"http://duckduckgo.com/PRISM_(surveillance_program)\">PRISM</a> - PRISM is a clandestine mass electronic surveillance data mining program known to have been operated by the United States National Security Agency (NSA) since 2007.", "Icon" : { "URL" : "", "Height" : "", "Width" : "" }, "FirstURL" : "http://duckduckgo.com/PRISM_(surveillance_program)", "Text" : "PRISM - PRISM is a clandestine mass electronic surveillance data mining program known to have been operated by the United States National Security Agency (NSA) since 2007." },但是,有時在“RealtedTopics”部分中,會出現一系列“Topics”,其中包含許多“Results”和該 Topic 的“Name”。
1 回答

慕無忌1623718
TA貢獻1744條經驗 獲得超4個贊
主題似乎包含一個切片Topics []Topic:
type Icon struct {
URL string
Height string
Width string
}
type Topic struct {
Result string
Icon Icon
FirstURL string
Text string
Topics []Topic `json:",omitempty"`
}
type RootObj struct {
RelatedTopics []Topic
}
- 1 回答
- 0 關注
- 231 瀏覽
添加回答
舉報
0/150
提交
取消