Golang

Prevent race condition in Go

using mutex.

Donald Le
Nov 16, 2020

--

Photo by Sincerely Media on Unsplash

When working with files or databases, or anything that relates to write permission, if we want to implement concurrency we need to implement lock. Because if we don’t, the data will be mess up by running concurrency.

So in Go, there is a couple of ways to do it like with mutex or using channel. In this post, we will use mutex for…

--

--

Donald Le

A passionate automation engineer who strongly believes in “A man can do anything he wants if he puts in the work”.