Golang

Sponsored links
Golang

Golang Implement Debounce logic in different ways

There are multiple ways to implement Debounce Logic in Golang. I want to compare the differences and check which one is ...
Golang

Golang How to implement Debounce and how to use time.Timer properly

timer.Timer is simple but it's not as straightforward to use it as it looks.What can we do with time.Timer?There are two...
Golang

Golang Which way is the best to declare array/slice

Have you ever considered the best way to declare an array/slice in Golang? Golang offers several ways to declare it. It'...
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 t...
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
Sponsored links