Interfaces in Go are going to be a foreign concept to many developers. For many, they will be coming from dynamic languages where interfaces aren't necessary, and for the devs coming from languages like Java they will have to drastically adjust their mindset to take advantage of Go's unique approach to interfaces. In this article we start diving into how those interfaces work.
Learn how to use sync.WaitGroup in concurrent Go code to wait for a group of goroutines to finish before proceeding with the rest of your code (or terminating the program if in main).
Nearly all apps need to talk other apps via API. In many cases we end up writing those API libraries on our own, which means we need to come up with a reliable way to test that code. In this article we explore techniques and advice that make it easier to test and maintain API client libraries written in Go.
When using domain driven design in Go, there are a few techniques that can be paired with DDD for a better overall experience. One of those is interface test suites - tests designed to run against any implementation of an interface. In this article we explore what interface test suites are, how to utilize them, and why they pair so well with DDD.
Domain driven design sounds great in theory, but how is it applied in Go? In this article we explore some code as it slowly evolves into DDD, learning how and why each decision is made along the way and what benefits it will provide us in the future. We then discuss the pros and cons of starting with a more domain-focuses design.
MVC is a well-known way to structure web applications, but it is often shunned in Go. In this article we explore how MVC can be effectively implement in Go as well as how to avoid all of the issues that many people associate with MVC.
Rather than spending time trying to figure out how to break code into packages, an app with a flat structure would just place all of the go files in a single package. This sounds kinda crazy, but can actually be a great facilitator of learning and letting code evolve into a better final state.
Getting started in Go can be hard. The language itself is pretty easy to pick up, but figuring out how to structure your application can be overwhelming early on. At least it was a big time sink for me coming from a Ruby on Rails background where all of those early decisions were made for me. As I progressed I kept wondering why I had to make all of these decisions myself. In this article we explore why that is the case.
With all of these development tutorials and courses on the internet, how do we get the most out of them? What tips and tricks are you using to maximize how much content you retain?
With all of these development tutorials and courses on the internet, how do we make sure we are retaining what we read? In this post I discuss different techniques that help improve how fast you learn, how much info is retained, and even ways to expand beyond what the tutorial is teaching.
Test driven development is thought of as a practice every developer should adhere to, yet many of us privately struggle to be productive using TDD. In this article we explore some of the reasons why TDD isn't always a great choice and can hinder your productivity
Everyone keeps saying you should be testing, but are they right? In this article we discuss the downsides to trying to learn testing too early and how it can negatively affect your ability to learn to code.
It is easy to get confused by when and why different variants of nil will be equal and when they won't be in Go. In this article we explore why this happens so that you know what to expect when writing your code.
Third screencast sample from my Go Web Development course (usegolang.com).
Second screencast sample from my Go Web Development course (usegolang.com).
First screencast sample from my Go Web Development course (usegolang.com).
I posted these questions on Twitter, but I want to get responses from a wider audience. When learnin...
We developers have a tendency to overcomplicate software to our dismay. In this post I discuss how I embraced simplicity while building the Gophercises website. (Gophercises is a free Go coding course I created)
Developing a web application without separating the logic used to parse an incoming request from the actual application logic can be painful. It is hard to test your card, dependencies aren't clear, and the code can become a mess. Learn how to apply the service object pattern to your Go code in order to properly isolate these concerns, making it easier to test, maintain, and read your code.
Sometimes you can't help but call a function that might panic. Rather than letting it blow up your code, learn how to use a deferred function and named return variables in order to capture the result as a standard Go error.
Learn how to properly secure cookies from tampering, theft, XSS, CSRF, and more in Go.
After using Go for a few weeks, chances are you are going to run across a single-line if...else statement. Most often, you will see this with an err (eg if err := doStuff(); err != nil { ... }). This article discusses the situations where a one-liner is appropriate, and ones where it isn't a great fit.
Learn to use functional options instead of method chaining to write cleaner and less bug prone code in Go.
Learn about how ORMs can lead to problematic code bases and some steps that can be used to avoid these issues.
Learn about how SQL injection can destroy data and how to avoid it when interacting with an SQL database in Go.
Learn how to use code generation to create type-safe code (like a Queue or LinkedList) in Go without having to rewrite the same thing over and over again.