© 2023 Hashnode
#golang
Introduction The Observer Pattern is a popular design pattern that allows an object (known as the subject) to notify its dependent objects (known as observers) automatically when a change occurs in th…
Games often require some kind of save and load system to allow the player to resume their progress from where they left off. The "Memento Pattern" is a perfect fit for this kind of system. In this art…
Let's just get right into it. Understanding Interfaces Think of interfaces as a set of behaviours. When someone or something implements this interface they define this set of behaviours on itself. For…
When it comes to releasing new features, it is often difficult to anticipate how users will react and interact with them. This is where A/B testing comes in useful. It provides a mechanism to test and…
My Go client library for the OpenAI API OpenAI and Go logos Introduction Open AI exposes an API that is quite simple to use. It requires its clients to register an API Key with an account on their we…
In Go it is good to use constants instead of regular variables to define identifiers for values that will not change during program execution. We use keyword "const" to define constants. package main …
The Mediator Pattern is a behavioral design pattern that helps to reduce the complexity of communication between objects by centralizing it through a mediator object. This pattern is part of the "Gang…
In this blog post, we will discuss a Golang code snippet that demonstrates how to convert a struct to a map. We will cover the different elements used in the code and walk through each step of the pro…
In the world of software engineering, design patterns are quite common. One of the most popular patterns is the "Iterator Pattern" which is part of the "Gang of Four" patterns. This pattern is used to…
In Go we can declare variables using keyword var. The variables can be visible in global scope or local. Global variables are definet at package level. Local variables can be defined in functions. Exa…