TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Go Data Structures (2009)

72 点作者 zachorr超过 11 年前

4 条评论

fauigerzigerk超过 11 年前
<i>&gt;As an aside, there is a well-known gotcha in Java and other languages that when you slice a string to save a small piece, the reference to the original keeps the entire original string in memory even though only a small amount is still needed. Go has this gotcha too.</i><p>That is no longer the case in Java. String.substring() now makes a copy. I think it doesn&#x27;t matter much which of the two approaches a language takes as long as everybody knows it. This needs to be in the language spec and can&#x27;t be an implementation issue.
评论 #6803025 未加载
iand超过 11 年前
Note that this is from 2009. Although the main details have not changed, the int type is more commonly 64 bits now (since 64 bit architectures are much more common)
评论 #6802941 未加载
codeflo超过 11 年前
I wish there were a way to create custom data structures without casting to and from interface{} all the time. Heck, it would already help if there were a shorthand for interface{}, like &quot;any&quot; or something.
评论 #6803706 未加载
grannyg00se超过 11 年前
make(* Point) seems much better than having a separate <i>new</i> keyword. Surprised to hear that was changed after just a few days.
评论 #6804120 未加载