Let's Go! by Alex Edwards
A highly praised and well regarded book in the Go community, Let's Go by Alex Edwards walks you through the process of structuring and organising your code for a web application.
As noted in the Prequisites section some knowledge of Go's basic syntax, HTML/CSS, SQL and terminal use makes the book a more fluid experience.
The book covers topics such as writing a database model, user authentication, request context, security measures against certain types of attacks (CSRF for example), all done using the standard Go tooling, no framework required!
The application takes the form of a code snippet storage and retrieval system:
The homepage:
Since all of our snippets are stored into a database we are able to retrieve them over time. Each snippet has a creation and expiry date.
User Signup:
When users sign up passwords are encrypted and stored securely.
User Login:
Once logged in authentication middleware is used to validate the incoming requests. If the user is logged in they are allowed to access certain pages, otherwise requests are redirected to the login page.
Snippet Create:
Database and User models are used to separate the application into manageable units.
Although you are provided with some HTML/CSS and JS files I was pleased to discover the book avoids walking you through the basics of those technologies. Afterall this is a Go book, however, you are tasked with modifying the HTML templates in order to render dynamic pages.
I found the book to be well paced with each chapter building on the foundations established in the previous. At no point did I feel I was being lead on a tangent or having ideas explained from nowhere. Everything was to the point and concisely written. The book was also properly formatted and presented, I didn't notice any grammatical errors or misspellings.
Although this isn't a large application the book delves into lots of detail, in total it took me about a month to complete. I will surely work through it again at some point to further concrete some of the lessons learnt. I highly recommend Let's Go for anyone interested in web application development in Go! Now I'm looking forward to reading Let's Go Further...
Subscribe to this blog's RSS feed