📺 YouTube: Suggestions #1

A hand holding a smartphone while youtube app is open

We live in an unprecedented era in which we can learn pretty much anything we want for free (or paying very little depending on how much patience you have with ads).

YouTube is undoubtedly one of the best sources of free content. The only challenge is really to find good channels where you learn stuff and have a good time while doing it.

This is the first issue of a series of posts in which I’m going to recommend three channels with excellent videos.

TechWorld with Nana

YouTube Channel Twitter

This is my favorite channel for DevOps-related topics. Nana’s didactics and real-world examples help a lot to get to know new topics or deep dive into a specific subject. This 4-hour long k8s full course is just one of many others. Check it out.

Continue reading...

📂 Go: Importig a CSV to PostgreSQL

contents of a CSV file with each column in a different color

If you are using Go ad PostgreSQL, and need to performa a bulk import a CSV, it’s most likely you will find the COPY protocol is the feature that suits you better. In that direction, you will find examples using pgx CopyFrom that relies on the native protocol, and it’s fairly easy to use. However, depending how it’s used you can have an exponencial increase of memory consumption of your application making it unreliable and more expensive to run.

Continue reading...

🔢 Go: Where is the decimal type?

Gopher side-eye

Go doesn’t have a primitive decimal type for arbitrary-precision fixed-point decimal numbers. Yes, you read it right. Therefore, if you need to deal with fixed-point precision there are two main options:

  • Use an external package like decimal, which introduces the decimal type. However, the current version (1.3.1), can “only” represent numbers with a maximum of 2^31 digits after the decimal point.
  • Use int64 to store and deal with these numbers. For e.g. given you need 6 precision digits, therefore 79.23, 23.00, and 54.123456, become respectively 79230000, 23000000, and 54123456.

There is an open proposal to add decimal float types (IEEE 754-2008) in the std lib. However, for now, it’s just a proposal being discussed, without guarantee it will be ever added.

🧠 Go resources for beginners

Gopher side-eye

Below a living list of compiled links for whoever is learning Go.

Official docs

  • Effective Go - https://go.dev/doc/effective_go
    • A document that gives tips for writing clear, idiomatic Go code. A must-read for any new Go programmer. It augments the tour and the language specification, both of which should be read first.
  • Go Code Review Comments https://github.com/golang/go/wiki/CodeReviewComment

    • This page collects common comments made during reviews of Go code, so that a single detailed explanation can be referred to by shorthands. This is a laundry list of common mistakes, not a comprehensive style guide. You can view this as a supplement to Effective Go.

Continue reading...

👋 Welcome

Gopher side-eye

Welcome, here I’ll be sharing my discoveries, studies, and experiences in the software industry. As a software engineer, I’ve had the opportunity to work on a variety of projects and technologies, and I’ve learned a lot along the way.

Continue reading...