<p><a href="https://github.com/hazrmard/gobol">Link to gobol</a> </p>
<p>I started learning Go at the beginning of this month. Go is not my first programming language. Naturally, I couldn't go through all the "Hello World" examples in <a href="https://tour.golang.org/">A Tour of Go</a>. But having an idea for something to make really helped me. Instead of having all the knowledge beforehand, I started with the fundamentals. I was able to incrementally build up my vocabulary as I worked on my project. </p>
<p>So, as someone freshly on the other side of the initial learning curve, that'd be my advice to newcomers: get a project to invest yourselves in. Then you'll <em>want</em> to stay up late and plough through all sorts of documentation to implement that one little feature you want. </p>
<p>Frankly, I was skeptical of Go at first. But having worked with Go's built-in concurrency and production-ready servers - I don't want to look back. </p>
<p><strong>Some resources I found helpful for quick testing/reference:</strong> </p>
<ul>
<li><a href="https://play.golang.org">Go playground</a><br/></li>
<li><a href="https://gobyexample.com">Go by example</a></li>
</ul>
<hr/>**评论:**<br/><br/>sethammons: <pre><p>Glad you had fun and wrote something to help you get familiar with Go. A project is always a great way to learn a new language. That said, you couldn't go through the tour? It is not some academic course; I think I went through it originally in like an hour or something trivial. It is just a tour and gives you an idea of some basics for interaction with Go. <em>Shrug</em></p></pre>HazrMard: <pre><p>I did not go through the entirety of the tour. But I did go through the basics. I found that without a context to apply all the concepts, I just forgot them after a while. So after the first couple of sections, I went to work on my project. I visited the remainder of the tour through google searches etc. as I looked for solutions.</p></pre>radovskyb: <pre><p>Hey there. Good to see you are enjoying Go... It really is fun and awesome to program with!</p>
<p>I've only skimmed over the <code>server.go</code> file for a quick peek so I haven't really read the code entirely or properly, but the one thing that really stuck out to me pretty quickly was the amount of errors handling that you're ignoring in your code. In general you should always be handling all errors, especially here where a lot of the errors that aren't being handled are errors that could potentially ruin the workflow of the program, for example creating your net listeners or reading from a connection.</p>
<p>One other tiny thing is that with http.Serve, if you are only going to be using the http.DefaultServeMux as it's handler, I would recommend leaving the handler parameter as nil.
Here's a line from it's documentation: <code>Handler is typically nil, in which case the DefaultServeMux is used.</code></p>
<p>Otherwise, nice job for a first program :)</p></pre>HazrMard: <pre><p>Thanks for the feedback. I'm definitely going to look into error handling. I haven't done much reading on that - I'm going to do that soon.</p></pre>radovskyb: <pre><p>Anytime! If you are ever looking for any more specific feedback for this or anything else you can always ask myself or just ask a question on here and people are usually more than happy to help, but either way, I do think writing programs is one of the best ways to learn anyway :)</p>
<p>Just so you know, there is also the Go forum (<a href="https://forum.golangbridge.org/" rel="nofollow">https://forum.golangbridge.org/</a>) and also the Gophers Slack channel (<a href="https://invite.slack.golangbridge.org/" rel="nofollow">https://invite.slack.golangbridge.org/</a>), which are both great resources for asking questions and learning!</p></pre>
这是一个分享于 的资源,其中的信息可能已经有所发展或是发生改变。
入群交流(和以上内容无关):加入Go大咖交流群,或添加微信:liuxiaoyan-s 备注:入群;或加QQ群:692541889
- 请尽量让自己的回复能够对别人有帮助
- 支持 Markdown 格式, **粗体**、~~删除线~~、
`单行代码`
- 支持 @ 本站用户;支持表情(输入 : 提示),见 Emoji cheat sheet
- 图片支持拖拽、截图粘贴等方式上传