Recent Articles
Golang Release 1.22: version
How to use the new package in Go standard library to work with Go version strings.
With the release of Go 1.22, the Go standard library introduced several new features. As you might have noticed in articles related to the previous release, here we mostly concentrate on the new exciting packages and features that they give us. This article will start this journey, by providing a deeper look into the implementation of the version package in Go.
Lang The first function we are ready to examine is the Lang function.
read more
Golang Release 1.21: slices - Part 2
How to use the new package in Go standard library to sort slices efficiently.
With the release of Go 1.21, the Go standard library introduced several new features. While we’ve already discussed some of them in previous articles, in this episode, we’ll dive into more advanced enhancements. Naturally, we’ll focus on the new functions designed for sorting slices, which are part of the new slices package. This article will provide a deeper look into the implementation of these three new functions and touch on benchmarking as well.
read more
Join the Ompluscator's Blog Community
Hey there! Want to be part of our awesome community? Just drop your email below, and we'll send you the good stuff – cool articles, fun updates, and more. No spam, we promise!
Thank you for subscribing!
Golang Release 1.21: slices - Part 1
New package in Go standard library that makes easier to work with slices.
As part of the new Go release, several exciting changes have been introduced to the Go ecosystem. While we’ve explored some of these changes in other articles about the maps package and the cmp package, there’s much more to discover beyond these two packages.
In this article, we’ll focus on the first part of the slices package, specifically its new search functionality. Like many other updates and newly introduced packages, this one is also built upon the foundation of generics, which were introduced in Go 1.
read more
Golang Release 1.21: cmp
New package in Go standard library that makes easier to compare ordered types.
As the new release of Go came this summer, many of us started to look for the improvements inside its ecosystem. Many new features were introduced, including updates to the tool command to support backward and forward compatibility. New packages appeared inside the Standard Library, including maps and slices. In this article we are covering improvements introduced with the new cmp package.
The new package offers three new functions. All of them rely on Generics, a feature introduced in Go version 1.
read more
Golang Release 1.21: maps
New package in Go standard library that makes easier to work with maps.
Not too long ago, we witnessed a new release of our favorite programming language. The Go team didn’t disappoint us once again. They introduced numerous new features, including updates to the tool command to support backward and forward compatibility. As always, the standard library has received new updates, and the first one we’ll explore in this article is the new maps package.
The new package offers only five new functions (two additional ones were removed from the package: Values and Keys), but they provide significant value.
read more
Golang Tutorial: Contract Testing with PACT
The Story about eliminating integration issues from our environments.
My favorite part of software development is writing tests, whether they are unit tests or integration tests. I enjoy the process immensely. There’s a certain satisfaction in creating a test case that uncovers a function’s failure. It brings me joy to discover a bug during development, knowing that I’ve fixed it before anyone encounters it in a test environment or, worse, in production. Sometimes, I stay up late just to write more tests; it’s like a hobby.
read more
Golang Tutorial: Generics with Gorm
Can we expect to have a comprehensive ORM and DBAL framework, similar to Doctrine, for Go?
After months and years of talking, trying things out, and testing, we’ve finally reached a big moment in our favorite programming language. The new Golang version, 1.18, is here. We knew it would bring significant changes to Go’s codebase, even before Generics was officially released. For a long time, when we wanted to make our code more general and abstract, we used code generators in Go. Learning what the “Go way” of doing things was challenging for many of us, but it also led to many breakthroughs.
read more
Golang Tutorial: Unit Testing with Mocking
Techniques that have helped me have zero bugs in production for 2 years.
Unit testing has always been my thing, almost like a hobby. There was a time when I was obsessed with it, and I made sure that all my projects had at least 90% unit test coverage. You can probably imagine how much time it can take to make such a significant change in the codebase. However, the result was worth it because I rarely encountered bugs related to business logic. Most of the issues were related to integration problems with other services or databases.
read more
Golang Tutorial: Generics
One feature to rule them all.
How often do we encounter significant changes in our preferred programming language? Some languages undergo frequent updates, while others remain traditional and stable. Go falls into the latter category, known for its consistency. “This is not the Go way!” is a phrase that often comes to mind. Most Go releases have focused on refining its existing principles. However, a major shift is on the horizon. The Go team has announced that Generics in Go are becoming a reality, moving beyond mere discussion and into implementation.
read more