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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

Introducing Go by Example

213 点作者 mmcgrana超过 12 年前

16 条评论

aaronblohowiak超过 12 年前
This is an old media presentation of something inherently interactive -- Alan Kay complains about how the wikipedia pages' code examples aren't executable. There is already the well-developed <a href="http://tour.golang.org/" rel="nofollow">http://tour.golang.org/</a>, which can be used freely.
评论 #4642970 未加载
评论 #4643224 未加载
评论 #4643675 未加载
pedoh超过 12 年前
I've never experimented with go, until now. I just ran all of the examples (found the mt=&#62;fmt typo which I believe has been fixed). I think this is a great way to start, thank you for building it.<p>I have a few suggestions.<p>Make the code easily copyable. Under Chrome, at any rate, if you select the code you can't help but select your comments to the left of the code. I think that people running through the examples should type everything in line by line, but some people will prefer to copy and paste.<p>Also, it would be great to have some "where to go from here" links. I've run the examples, now I want to write some useful code. Where should I go next?
评论 #4642730 未加载
icey超过 12 年前
Mark, I'm curious to know if you find yourself using Go or Clojure more these days.<p>They're quite different languages, so I was surprised to see a bunch of Go libraries in your Github after using a bunch of Clojure gear you'd written over the years.
评论 #4641851 未加载
Stratoscope超过 12 年前
I really like the way this is set up with lengthy examples next to the explanatory text. I look forward to reading through it. Thanks!<p>In the meantime, mind a quick comment on the typography? The Palatino Linotype body text renders poorly on Windows. Italics are particularly hard to read.<p>I tried changing it to Georgia and it made a world of difference:<p><a href="http://mg.to/images/go-by-example-palatino.png" rel="nofollow">http://mg.to/images/go-by-example-palatino.png</a><p><a href="http://mg.to/images/go-by-example-georgia.png" rel="nofollow">http://mg.to/images/go-by-example-georgia.png</a>
评论 #4642694 未加载
bryanlarsen超过 12 年前
That's a great format for short examples. I'm kind of proud of this hobo tutorial[1], which I put together a few years ago. It uses the git commit comment for the article text, giving a clear explanation on how to evolve a larger program. This format will make it very easy for me to update it to Hobo 2.0 without introducing the inevitable mistakes you'd get just updating a text document.<p>1: <a href="http://cookbook.hobocentral.net/tutorials/agility" rel="nofollow">http://cookbook.hobocentral.net/tutorials/agility</a>
mseepgood超过 12 年前
<a href="https://gobyexample.com/slices" rel="nofollow">https://gobyexample.com/slices</a> gives the impression that arrays and slices are independent things, which is not true. A slice cannot exist without an underlying array. A slice is a window view on an array, a reference to a part of an array. Multiple slices can provide different views on the same array. When you create a completely new slice you also create a new underlying array and the window size is initially the same as the size of the array.
评论 #4642182 未加载
dsl超过 12 年前
If you just want the good stuff, it is at <a href="https://gobyexample.com/" rel="nofollow">https://gobyexample.com/</a>
trung_pham超过 12 年前
Very cool. Maybe Go will win some people back to the strongly typed language realm. Having the compiler acts as a safety net is pretty awesome. Much better than having your code blow up at run time with dynamic languages.
评论 #4641880 未加载
评论 #4644591 未加载
评论 #4641769 未加载
评论 #4641684 未加载
nixarn超过 12 年前
Quick Go question. I haven't done much go coding at all, but play around with the language. I've been reading a lot about it (thanks to HN). So I was now looking at the Slices section and noticed a slice being initalize as:<p>t := []int{1, 2, 3, 4, 5}<p>What makes that a slice and not an array?<p>EDIT: Ok, found that answer on google go's blog. Apparently leaving out the length makes it one.
评论 #4642955 未加载
kolektiv超过 12 年前
Looks like an excellent project, with a really clear and simple approach. I'd love to see more of these approaches for other languages, but I'm looking forward to working through this one.
jcurbo超过 12 年前
Looks very nice, I am gearing up to really dive into Go soon (waiting to finish up a class, to free up the time) and this looks like it will be a good resource.
jamesmiller5超过 12 年前
These are the kinds of guides that I think the budding gopher needs. Golang.org has some beautiful examples but they are a bit terse.
RivieraKid超过 12 年前
This is a really good format. One of the best language tutorials I've seen.
Myrmornis超过 12 年前
This is great. Much better speed than <a href="http://tour.golang.org" rel="nofollow">http://tour.golang.org</a> for people who already know other languages. Thanks!
ragsagar超过 12 年前
Nice, I was looking for something like this.
hntester123超过 12 年前
Congrats on the site and thanks. As a guy interested in Go, I plan to check it out over time.