TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

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

56 pointsby jemeshsualmost 13 years ago

4 comments

jcurboalmost 13 years ago
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>
nickprestaalmost 13 years ago
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 未加载
e12ealmost 13 years ago
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 未加载
biomechanicaalmost 13 years ago
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.