CatOps
5.68K subscribers
94 photos
4 videos
19 files
2.25K links
DevOps and other issues by Yurii Rochniak (@grem1in) - SRE @ Preply && Maksym Vlasov (@MaxymVlasov) - Engineer @ Star. Opinions on our own.

We do not post ads including event announcements. Please, do not bother us with such requests!
Download Telegram
There was a question in CatOps chat regarding the resources to learn the Go programming language from scratch with the background in other technologies.

So, here is a quick ad-hoc list of resources, we came up with:

Books:
- Go in Practice
- The Go Programming Language

Courses and tutorials:
- Practical Go Lessons
- Algorythms with Go
- Go by Example
- Effective Go

Blogs:
- Three Dots Labs

Of course, you can also find a great list of learning materials in the Awesome Go list

If you would like to add to this short list - welcome in the comments!

#programming #go
DevOps-ish community loves Go.

So, here's a short story about simple re-arranging fields in a struct that saved 1/3 of memory consumption.

#programming #go #performance
Not so long time ago, I shared with you a tool called Acra for encryption/decryption of sensitive data in a database. This tool is written in Go, and obviously it uses TLS.

Now, they have written an article about TLS implementation in Go, specifically about the implementation of OCSP and CRL extensions.

This article would be interesting for you, foremost, to get some ideas on OCSP and CRL extensions and their use cases. Secondly, if you need to implement TLS in your apps or advise on the implementation to your developers.

#security #programming #go #tls
A nice small article on when it makes sense to use pointers in Go.

As with the previous article, if you write in Go a lot that would probably provide you no new information. However, if you’re just learning it or switching from another language like Python, or writing Go code not that frequent; this article should be interesting.

And a quote:

In fact, I'll quote Ben Darnell, who is the lead engineer of CockroachDB (built in Go) :

"Whenever in doubt, use a value instead of a pointer"


#go #programming
So, on Friday I told you that I’m working on something new and now I’m ready to drop yet another teaser!

In nutshell, I’m going to write a series of articles on the basics of CLI applications in Go. A teaser or Part 0 of this series is already available in my blog!

There I talk about side projects and my motivation to write that tiny app as well as to start this series.

I will post new parts here as they appear. Also, you can subscribe to the CatOps newsletter to get bi-weekly digest of what has happened here.

#go #programming #blog #oc
Now, Go ecosystem has a vulnerability checker in their toolset.

From the doc:

 new govulncheck command is a low-noise, reliable way for Go users to learn about known vulnerabilities that may affect their projects. Govulncheck analyzes your codebase and only surfaces vulnerabilities that actually affect you, based on which functions in your code are transitively calling vulnerable functions.


Just keep in mind that you have to have Go version >= 1.18.

#go #programming
This is a small nice article about how small changes could impact performance.

I like such stories very much. I believe, they expose the beauty of software engineering. Just like in maths classes complex equations result in something like x = 1.

Also, one can learn from this article a thing or two about the memory allocation in Go as well as some performance profiling techniques.

#programming #go #performance
Here’s an article on Currying in Go. Currying is a technique borrowed from the functional programming. It’s essentially a partial implementation of a function.

Anyways, I find such articles interesting, because they show some unconventional angles of a language. I haven’t personally used currying in Go yet. However, examples in that article look reasonable. Maybe, one I day I will try it.

I’m not saying that you should use this technique in your code, but maybe you find it useful. In the latter case, you’re welcome!

#go #programming
Notify is a simple Go library to send notifications to various channels e.g. popular messengers, social apps and message services such as SNS.

You can find the list of all supported destinations as well as an example of usage in the README.

#programming #go
So, I was out for some time because both FOSDEM and Cfgmgmt Camp conferences are back offline.

Here you can find some notes from a friend of mine on some talks from the Go devroom:
- Summary “Five Steps to Make Your Go Code Faster & More Efficient”
- Summary “Squeezing a go function”
- Summary “Recipes for reducing cognitive load”

I need some time to process both conferences and write something on my own. I'll try to do it this week, but no commitments.

Also, a lot of FOSDEM videos are already available online. You can check them out on the official website.

#slides #go #programing
​​I've been working a lot with Makefiles lately, and I must say, it's not the most pleasant experience. Back in a day, I had a post here about how to replace GNU Make with Python's Invoke.

Today, I want to share a tool called Mage. It is a make/rake-like build tool using Go that depends only on Go's standard library. Ofc, some other Go-based task execution tools exist, like, for example Task.

However, unlike Task, Mage leverages plain Go syntax while Task uses YAML to define its recipes. Thus, Mage is much more flexible, especially when it comes to loops and so on. Also, you can write automation for your projects with Go!

P.S. A link to the post about Invoke.

#go #tools
Handling concurrency is hard, even if it was made simple.

The Go 1.19 Atomic Wrappers and why to use them explores the sync/atomic package which was introduced in Go 1.19 and use cases for it.

I haven't used this one personally, but we have sync.Map in one of the projects to get the results from goroutines in one place.

#go #programming
Avoiding Pitfalls in Go is a good article for those who just starts their journey with this language.

Yet, there are some aspects that are useful even if you use it already. Especially, if your use cases were limited to some simple code.

#programming #go
Bounded channels is a common way of limiting the concurrency in Go applications.

From this article you can learn some theory behind this approach as well as about the sync/semaphore package. I didn’t know about the latter.

#programming #go
If you have AWS Lambdas in Go, you likely know that AWS is going to deprecate the go1.x runtime and forces its users to migrate to the generic al2.provided runtime.

The premise is that the new runtime is more performant. However, here is an article that argues why this move is bad for Go users on AWS as well as goes through some caveats you may encounter during the migration.

#go #aws #serverless
I think I have posted something like this before, but anyway...

Here's a two part story of how to optimize memory usage of a Go application just by reshuffling fields in structs.

Part one provides some theory on this matter, while part two has some benchmarking results.

I'm not trying to say that you should run and reshuffle fields in all your Go structs right now. Especially, if you're satisfied with the memory consumption of your app - sometimes it makes sense to optimize for readability or just store pointers in structs.

However, these articles describe some details of how memory allocation works in Go, which you may find interesting.

#programming #go