-
My GopherCon UK 2025 talk Climbing the Testing Pyramid: From Real Service to Interface Mocks in Go can be watched on youtube. This is the first time I am speaking at GopherCon and also in front of a large audience of nearly 150 people. This talk explores the various strategies for unit testing Go applications that …
Read More -
Why mocks are needed? I generally prefer testing my code without using mocks. For example, if the code is integrated with Elastic Search, I prefer to run a elastic search container locally and test the Go code against that container. But there are some cases where creating a local environment for testing is not …
Read More -
Go 1.24 introduced a new json struct tag called omitzero. It handles a couple of scenarios that the existing omitempty tag couldn’t. Let’s look at them one by one. Marshalling empty time.Time struct fields Let’s say we have the following customer struct 1type customer struct { 2 Name string …
Read More -
Admission Controllers Admission controllers provide a mechanism to validate or modify Kubernetes object creation requests before the object is actually created. This definition might not make complete sense right now but we will be able to understand what this means as the tutorial progresses, so don’t worry …
Read More -
What are WebSockets and what are their advantages over traditional HTTP? HTTP is simply a request response protocol. This means a client such as a web browser sends a request and the server works on this request and sends a response. This request and response uses a TCP connection underneath. Once the response is …
Read More -
Why migrate to Hugo? Why migrate golangbot.com from Ghost to Hugo is the first question that will pop in your mind when you read this post. golangbot.com is 6 years old and it has been powered by Ghost since its inception. Ghost has stood the test of time and it has served me well. Why migrate to Hugo then? Well I have …
Read More -
What is a context? Context is a package in the standard library which is mainly used to propagate cancellation signals from one function to another or even from micro service to another. Let’s consider the example of a user sending a get request to a web server to download 50 images, zip it and send the zipped …
Read More -
Welcome to tutorial no. 32 in our Golang tutorial series. In this tutorial we will learn about error wrapping in Go and why do we even need error wrapping. Let’s get started. What is error wrapping? Error wrapping is the process of encapsulating one error into another. Let’s say we have a web server which …
Read More -
Welcome to tutorial no. 3 in our MySQL tutorial series. In the previous tutorial, we discussed creating a table and inserting rows into the table. In this tutorial, we will learn how to select a single row as well as multiple rows from a table. MySQL Series Index Connecting to MySQL and creating a Database Creating a …
Read More -
Welcome to tutorial no. 2 in our MySQL tutorial series. In the first tutorial, we discussed how to connect to MySQL and create a database. In this tutorial, we will learn how to create a table and insert records into that table. MySQL Series Index Connecting to MySQL and creating a Database Creating a Table and …
Read More