2 liens privés
Today I wanted to talk about a useful pattern I started to use in my Go programs. Suppose you have some service that needs to connect to the database. This is how it probably looks like:
db, err := sqlx.Connect("postgres", DSN) if err != nil { return nil, errors.Wrap(err, "failed to connect to db") } Nice and familiar but why fail immediately? We can certainly do better!
We can just wait a little bit for a database in a loop because databases may come up later tha our service.
How to use the defer function in Golang to execute code at the beginning and the end of any function.
Flight rules for git. Contribute to k88hudson/git-flight-rules development by creating an account on GitHub.
The name "ENTRYPOINT" always confused me. To me, the name implied that every container must have ENTRYPOINT defined. But after reading the official documentation, I realized that this is not true! Fact 1: You need at least one (ENTRYPOINT or CMD) defined (in order to run) If you don't define
favicon-cheat-sheet - Obsessive cheat sheet to favicon sizes/types. Please contribute! (Note: this may be in flux as I learn new things about favicon best practices.)
Intro Recently I wanted to deepen my understanding of bash by researching as much of it as possible. Because I felt bash is an often-used (and under-understood) technology, I ended up writing a boo…