Browsed by
Tag: code

Working with Date and Time in Golang

Working with Date and Time in Golang

Managing dates and times is a common task in many applications, whether it’s logging events, scheduling tasks, or measuring time intervals. Go, as a modern programming language, offers a robust set of built-in tools for handling date and time efficiently. The time package in Go provides various utilities to work with time zones, parse and format dates, measure time durations, and perform operations like adding or subtracting time. In this article, we will explore the basics of working with date…

Read More Read More

Implementing counting sort with Golang

Implementing counting sort with Golang

What it is counting sort Counting Sort is an algorithm for sorting keys that are small integers and repeatable values. However, it is not recommended for large keys because the logic consists of using an array where the value serves as the index of the array to store the counts of each key. Thus, the length of this array is calculated as store = len(max – min + 1). After that, the algorithm rebuilds the order of the values according…

Read More Read More

Go – goroutines and channels

Go – goroutines and channels

When you have to deal with concurrency problems, Go has a strong advantage to deal with it. goroutine it is the way that Go supports concurrency, running simultaneous function in a differently Thread from the main, cleverly managed by the runtime. From the golang documentation, this is how they explain about it. A goroutine is a lightweight thread managed by the Go runtime. In this blog post, i will try to show this, exploring why they are a game-changer for concurrent programming…

Read More Read More