Go is a common and well-suited tool for writing HTTP servers. This post discusses the route a typical HTTP request takes through a Go server, touching upon routers, middleware and other related issues like concurrency.
In this blog post I’ll explore a way to implement gRPC long-lived streaming. Using gRPC is perfect for cloud native applications mainly since it is modern, bandwidth and CPU efficient and low latency which is exactly what distributed systems require.
If you’re reading this I assume you are already familiar with gRPC. But if you still feel like you need an introduction, please leave a comment below and I will put together a gRPC introductory post as well.
A couple of weeks ago a friend of mine asked me to look into a little project of his, since something didn’t seem to work and I had some prior experience with the netlink library.
Tailscale is a networking application so naturally we need to work with and manipulate IP addresses and sets of IP addresses often.
Being written almost entirely in Go, the obvious choice would be for Tailscale to use the Go standard library’s
net.IP address type for individual IPs and
net.IPNet type for networks. Unfortunately, the standard library’s types have a number of problems, so we wrote a new package,
inet.af/netaddr (github) containing a new IP type and more.
Running a microservices-based architecture here at Aluma means we’re able to trial new technologies when developing new features, without having to rewrite a monolith. We'd already been using Go for our command-line client, but around a year ago we tried out Go for a new microservice, and we liked it so much we decided to use it for all future backend development work where possible.
This post is about how we made that decision and how we pitted C# on dotnet core against Go.
In this crash course, we’ll cover everything you need to know about gRPC and integrating it with your Go applications.
Each of the sub-articles below are written in a way that they are independent from one another, so if you’re interested in only going through a specific part of the course, feel free to do so.
Go is not an easy programming language. It is simple in many ways: the syntax is simple, most of the semantics are simple. But a language is more than just syntax; it’s about doing useful stuff. And doing useful stuff is not always easy in Go.
If you haven't worked in a typed language before, it may not be obvious at first the power that it brings. This article will show you how to leverage the type system to make your code easier to use and more reusable.
I have been exploring how disk-oriented databases efficiently move data in and out of disk. One way, that I explored in Discovering and exploring mmap using Go and But how, exactly, databases use mmap?, is through memory-mapped files. Although
mmap is a really neat solution, it has some troubles. Most troubles come from the fact that the database has no control of how pages are flushed to disk since that job is carried through the OS. Because of that most databases avoid using
mmap. However, they still need to read and write data from disk in an efficient manner. And the answer to that is: buffer pool.
After many years in the making, Go's generics proposal has been accepted this week! This is great news for the Go community; the earliest attempt to add generics to Go was in 2010, before the release of Go 1.0.
I believe the current proposal strikes a good balance between expressivity and comprehensibility. It should allow Go programmers to express 95% of the things generics were most wanted for, while making it hard or impossible to write inscrutable code for which generics have a bad name in other languages. As it stands now, the Go team is working on getting generics into the language in 1.18 (beta will be available in Dec 2021), though these timelines aren't final.
Testing is an important aspect of software development. Let’s see how Property-based Testing can help us to test our Go programs.
A few weeks ago, I gave a talk about Property-based Testing using Golang on our awesome Engineering Summit 2020 @ eGym, which I tidied up, included more details and now I want to share with you in this blog post.
In this installment of our cheatsheet series, we’re going to cover eight Go security best practices for Go developers. The Go language incorporates many built-in features that promote safer development practices—compared to older and lower-level languages like C—such as memory garbage collection and strongly-typed pointers.
In this post, we will outline a reference architecture for setting up K3s in a High Availability (HA) configuration. This means that your K3s cluster can tolerate a failure and remain up and running and serving traffic to your users. Your applications should also be built and configured for high availability, but that is beyond the scope of this tutorial.
K3s is a lightweight certified Kubernetes distribution developed at Rancher Labs that built is for IoT and edge computing.
Today we’re having a look at how to set up a GitOps pipeline for your Kubernetes cluster with Flux v2.
We will first go through some core concepts of Flux and then create our first GitOps workflow.
You will need access to a Kubernetes cluster, a shell interface and a Github account to follow this guide. Note that you can use any git provider (Gitlab, Bitbucket, custom) but you’ll have to modify the provided example commands.
Golang, developed in 2009, is one of the most popular programming languages in the world. At Codecov, it currently sits as the language of choice for over 14% of our open-source repositories, or as the 3rd most widely used language. This blog post will show you how to get a simple Golang project up and running with tests and code coverage with Codecov. You can view the entire source code of this post at our example repository.
Just a quick one to share something useful I learnt about injecting variable values at build time in Golang. The usecase for this was adding a Slack webhook URL to a GUI application without either shipping the webhook URL in the code, or expecting the end user to set an ENV VAR with the webhook URL in it.
Since learning this, I have decided to add /info endpoints into my applications that have the commit hash and date in them, for troubleshooting purposes.
Go helps you make faster scalable backends and this guide will show you how to connect your backend to Ethereum (and make it even faster, more reliable, and globally accessible, all thanks to QuikNode’s global infrastructure).
Go has taken the programming world by storm. When it recently passed its ten-year anniversary, estimates suggested as many as 2 million people use the language. As that number continues to grow, common mistakes have emerged that can lead to bugs and security vulnerabilities. In this article, I will address some of them so you can arm yourself with the knowledge to write more robust, secure Go applications, and avoid SQL injections and other security issues.
About the hidden costs of forced automatic initialization of dependencies. And a plea for library developers (in any language) to think about their global state initialization requirements.
An application should be easy to use. You’ve heard it before, about the legacy app that was migrated, and now the guy who managed it is no longer around. No one knows how it works. This is how I use Cobra for easy Golang cli flags for all my apps that need it.
In this post, I share mistakes I’ve made writing Go code for six years since the beginning of my journey with the language.
In Go, you can define the special function init multiple times on a single package or file. From Effective Go, we learn that:
init is called after all the variable declarations in the package have evaluated their initializers, and those are evaluated only after all the imported packages have been initialized.
There are many good reasons why learning Golang is a popular idea altogether – StackOverflow’s 2020 Developer survey saw it climb in popularity among developers from 10th in 2019 all the way to 5th in 2020. A full 32% of developers surveyed in Insights Dice want to learn it. It pays well – globally, the StackOverflow survey found that Perl, Scala, and Go programmers have the highest salaries.
The Go SDK team is excited to announce support for AWS Single Sign-On (SSO) credential providers in the AWS SDK for Go version 1 and version 2. The AWS SSO credential provider allows you to retrieve temporary AWS credentials associated with an AWS account and a role that you have been authorized to use with AWS SSO. The SDK seamlessly integrates with your AWS SSO named profiles that have been configured and signed-in using the AWS CLI v2. Let’s take a look at how you can quickly get started using AWS SSO in your Go applications.
Go is one of the fast-growing open-source programming languages that provide you with simple, reliable, and efficient ways to build a software application. Technology engineers at Google designed Go as an alternative to C++ that solves the issues of software engineering. With exciting features and efficiency, Go has been chosen by most developers for developing applications at ease. One of the other major reasons to choose Go is that it has huge community support and thousands of projects and repositories in Github to support the developers.
When onboarding and training new engineers at FlowUp, I started realizing how much time it takes to deeply understand how Dockerfiles work. Meanwhile, we were always maintaining that single “best-practice” Dockerfile for all of our projects. It suddenly made sense to get rid of Dockerfiles where possible.
We still use Dockerfiles for specific cases. However, I wanted to make sure, deep knowledge is not needed as a base knowledge to deploy to Cloud environments (Kubernetes, Cloud Run, or other container environments).