Golang

Sponsored links
Golang

Golang 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...
Golang

Golang 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...
Golang

Golang 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....
Golang

Golang 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.
Golang

Golang 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.
Golang

Golang 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 ...
Golang

Golang 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 a
Golang

Golang 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.
Golang

Golang 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!
Golang

Golang 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 ...
Sponsored links