为什么我不能创建常量结构?
const FEED_TO_INSERT = quzx.RssFeed{ 0,
"",
"desc",
"www.some-site.com",
"upd_url",
"img_title",
"img_url",
0,
0,
0,
0,
0,
100,
"alt_name",
1,
1,
1,
"test",
100,
100,
0 }
.\rss_test.go:32: 常量初始值设定项 quzx.RssFeed 文字不是常量
原文由 ceth 发布,翻译遵循 CC BY-SA 4.0 许可协议
因为 Go 不支持结构常量(强调我的)
在这里阅读更多: https ://golang.org/ref/spec#Constants