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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

Go Tutorial: Object Orientation and Go's Special Data Types

56 点作者 jemeshsu将近 13 年前

4 条评论

jcurbo将近 13 年前
Just a note, this is adapted from the author's book Programming in Go.<p><a href="http://www.amazon.com/Programming-Go-Creating-Applications-Developers/dp/0321774639/" rel="nofollow">http://www.amazon.com/Programming-Go-Creating-Applications-D...</a><p>This article is second in a series. Discussion of the previous article on HN: <a href="http://news.ycombinator.com/item?id=4351992" rel="nofollow">http://news.ycombinator.com/item?id=4351992</a>
nickpresta将近 13 年前
I know you can use the empty interface but it hands off type checking to the runtime, which neglects the type system for a bit of generality and defeats the safety of having static typing in the first place.
评论 #4382441 未加载
e12e将近 13 年前
Thanks for this - I've been through the golang wiki tutorial, but this (ab)use of an empty interface for storing "any"-type in a collection was a great idiom to be aware of.
评论 #4381577 未加载
biomechanica将近 13 年前
I actually quite like this language. I'm learning C right now and love it, but I gotta say, Go is really starting to catch my eye.