<p>Hello,
I've been trying to learn go for the past two days, but I feel like I haven't made much progress. Since I know how to make basic/intermediate PHP web applications and have had some experience in c# and java I thought learning go would've been a smooth ride. I think it's fair to say I have overestimated my capabilities. </p>
<p>I feel like I'm just having a hard time grasping the main concept behind it; what exactly is go. I've always like to code everything as barebones as possible (no framework and minimal libraries) to make my web apps and therefore thought go would fit my needs since it seems to do the job of apache and PHP at the same time. Was I wrong? Every time I try to look for a tutorial they always talk about frameworks and there seems to be many. Is "raw" go only use for specific server-side scripts or can you make a whole web app from scratch only using go?</p>
<p>Do you guys have any tips or good resources for learning go or making a go web application from scratch (w/o framework) or am I looking in the wrong place? Thank you very much for your help!</p>
<hr/>**评论:**<br/><br/>PacNinja: <pre><p>Sticking to stdlib(+ router if needed) is what the <a href="https://www.reddit.com/r/golang/search?q=web+frameworks&restrict_sr=on&sort=relevance&t=all" rel="nofollow">community recommends</a>.</p>
<p>Resources:</p>
<ul>
<li><a href="https://tour.golang.org/welcome/1" rel="nofollow">Tour of Go</a>: Language basics</li>
<li><a href="https://golang.org/doc/articles/wiki/" rel="nofollow">Official tutorial on Writing Web Apps</a>: For learning basic program structure of a web app<br/></li>
<li><a href="https://godoc.org/net/http" rel="nofollow">net/http docs</a>: For general reference</li>
<li><a href="https://thewhitetulip.gitbooks.io/webapp-with-golang-anti-textbook/content/" rel="nofollow">web-dev-golang-anti-textbook</a>: Covers almost everything(auth, templates, db etc.) you need for a web app and it doesn't use any frameworks.</li>
<li><a href="https://medium.com/@benbjohnson/structuring-applications-in-go-3b04be4ff091" rel="nofollow">Structuring Applications in Go</a>: Teaches you how to structure your web app</li>
</ul>
<p>Tips: Read the docs.!</p></pre>thewhitetulip: <pre><p><a href="https://www.youtube.com/playlist?list=PL41psiCma00wgiTKkAZwJiwtLTdcyEyc4" rel="nofollow">https://www.youtube.com/playlist?list=PL41psiCma00wgiTKkAZwJiwtLTdcyEyc4</a></p>
<p>Is the youtube series based on web-dev-golang-anti-textbook linked above.</p></pre>slrz: <pre><p>Don't ever search for tutorials. That word somehow triggers search engines to return you the most filthy crap content the web has to offer.</p></pre>dmikalova: <pre><p>Yeah all the tutorials are at best extremely specific. Better to just get a book.</p></pre>chmikes: <pre><p>There is no need for a framework. I do use some of the gorilla tools (<a href="http://www.gorillatoolkit.org/" rel="nofollow">http://www.gorillatoolkit.org/</a>), but only where I really need it (e.g. Mux). I minimize external dependencies to avoid making my life a nightmare by keeping all packages up to date and working well together. Sticking with stdlib is the most popular policy. </p>
<p>But it takes time to learn how to do it properly. It is not easy to learn from the Go documentation. Go by example is good to have a dip in Go but not to learn all possibilities and master the language and its libraries. There is a gap there that still needs to be filled. </p></pre>TransistorNetwork: <pre><p>Not sure if you have already completed it but the Go tour is a really great place to start learning the language: <a href="https://tour.golang.org/welcome/1" rel="nofollow">https://tour.golang.org/welcome/1</a></p>
<p>I realize its not about web apps but it gives you exposure to a lot of go libraries you might need regardless of what you are doing.</p></pre>carsncode: <pre><p>You can absolutely just use the standard library and I recommend it for most cases, especially when you're just learning Go. I recommend the basic walkthrough on the official site, it'll get you started with the basic concepts using just the standard library. Then pick a problem you want to solve in go and take it from there - with few vanilla go tutorials to go on, you'll have to forge your own by just building a project. Even if it doesn't turn out well, it'll give you direction in your learning.</p></pre>itsmontoya: <pre><p>I use the stdlib almost exclusively with my projects. One if the great things about go is that you can do so much with only using stdlib. When you need something extra, there is USUALLY a library for it.</p></pre>drailing: <pre><p>Started with go a few weeks ago, but just with the first http handler I need to search for a router, isn't it? Things like url parameters or declarative GET / POST handling is not included, or did I miss something?</p></pre>sethammons: <pre><p>URL parameters (/resource/:id) and automatic routing for GET / POST: you can roll your own and it is not overly difficult. However, when you need these, I recommend the Gorilla Toolkit. It is not a framework, but a collection of packages that make things like this easier than rolling your own. </p></pre>itsmontoya: <pre><p>Julian Schmidt's http router or Gorilla Mux is solid for URL params</p></pre>drailing: <pre><p>I found <a href="https://husobee.github.io/golang/urlrouter/vestigo/2015/09/22/vesigo.html" rel="nofollow">https://husobee.github.io/golang/urlrouter/vestigo/2015/09/22/vesigo.html</a> </p>
<p>Searched for a router only, because I read everywhere the std lib fits for most cases. Second I added gorm</p></pre>metamatic: <pre><p>I use <a href="https://godoc.org/github.com/bouk/httprouter" rel="nofollow">https://godoc.org/github.com/bouk/httprouter</a> because it's as solid as httprouter, but supports Context and standard method signatures.</p></pre>klippos: <pre><p>Hey,</p>
<p>I was like you few months back.
I wanted to learn Go but had very difficult time to understand it and make something of it.
I tried for 2weeks and put this aside to return to my old Python.</p>
<p>And recently, with a personal Python project (in microservices), I was asking myself: "let's give it another chance, pretty sure I can do something".</p>
<p>I took one of the service and try to rewrite it in Go. When I didn't understand something I went into the doc and try to see what's was going on there:
- What this func do and what it return. </p>
<p>As of today, the service was rewritten in Go and is functional ! It's not the best and pretty code over there but it's working.
I continued with some unittest <- very important, didn't really bother with it before but it helps me to see that certain parts of my code wasn't good or could be better.</p>
<p>Word of advice, <strong>don't give up</strong> !
It can be difficult, sometime really annoying but when you start to understand even an little piece of it, you'll be happy that you didn't.</p></pre>proyb2: <pre><p>You could write a basic web application or websites from scratch. If you do not feel making progress, it is normal. We struggle because from your experience is different from Go syntax. It is always an alien for most programmers learning new languages. Learning how to code for a website maybe a bad idea, you should consider benchmarking different languages to get the idea how fast does it perform with as low as C before you adopt it.</p>
<p>Hacking enough knowledge with Go before you adopt a web framework. </p></pre>
![](https://static.golangjob.cn/static/img/banner.png)