GolangGolang When should Atomic be used instead of Mutex? I have used sync.atomic for the first time in my work. It's lighter than Mutex. If the program requires speed and it doe...2023.11.10Golang
GolangGolang Unit testing with Gomega matcher A function result somehow needs to be compared in a unit test to know whether the function returns the expected value or...2023.10.04Golang
GolangGolang A good way to get struct data with gomega matcher It took me about 20 minutes to know the way to access a property in a struct that is passed by a channel in a unit test....2023.10.02Golang
GolangGolang errors.Is() does not work for Custom error? How can a custom error implemented in Golang? Define struct and Error() method for it. Implement Is() method if errors.Is() needs to be used for the custom error.2023.08.04Golang
GolangGolang Mock File System for unit testing by afero It's often problematic to create a test directory or file on the actual file system because they are need to be deleted after each test. Don't stop it. Let's use afero package to do it on the memory.2023.07.17Golang
GolangGolang How to define gRPC message to contain mixed data type in an array Check the following post first if you have not prepared a dev-env for gRPC in Go lang. In this post, we will go through ...2023.06.26Golang
GolangGolang gRPC unary, stream, bidirectional RPC examples gRPC has 4 types of functions. This post covers all the functions to explain how to implement them. Let's a2023.06.05Golang
GolangGolang How to filter a Slice with Generics Golang doesn't provide utility functions for Slice. It's easy to implement filter to filter the element but it should be implemented with Generics. Let's check how to do it.2023.06.02Golang
GolangGolang Generics type constraints with interface and Tilda How can we implement if an extended type (Type Definition) needs to be covered by interface for Generics? Let's define an interface with Tilda!2023.05.31Golang
GolangGolang How to start using gRPC in devcontainer gRPC is one of the nice tools when two applications need to be communicated with each other. It's not hard to implement ...2023.05.24Golang