๐Ÿ‡บ๐Ÿ‡ฆ Go for two :)
1.18K subscribers
22 photos
3 files
184 links
Telegram channel about tricks and engineering practices in the Go programming language over a cup of coffee โ˜•๏ธ.

author: @a_soldatenko
personal blog: https://asoldatenko.org

#golang #go #kubernetes #debugging
ๅŠ ๅ…ฅ้ข‘้“
Finally we can use it without many lines of / and &&


Tl;dr:
With all that out the way, we can use a heredoc, executing two commands in the same RUN!:

RUN <<EOF
echo "Hello" >> /hello
echo "World!" >> /hello
EOF

->
https://www.docker.com/blog/introduction-to-heredocs-in-dockerfiles/
Discussion of 1BRC in Go https://github.com/gunnarmorling/1brc/discussions/67

Context: https://twitter.com/gunnarmorling posted a problem https://www.morling.dev/blog/one-billion-row-challenge/ the idea is pretty simple and from another side not so simple:

>write a Java program for retrieving temperature measurement values from a text file and calculating the min, mean, and max temperature per weather station. Thereโ€™s just one caveat: the file has 1,000,000,000 rows!
Goโ€™s CompareAndSwap is not always Compare-and-swap

>Go's standard package sync/atomics provides programmers with functions to use the underlying CPU-level atomic operations such as compare-and-swap (CAS), through atomic.CompareAndSwapT (where T is an integer type).

> Problem: Not all CPU architectures offers a CAS instruction to rely on to implement atomic.CompareAndSwapT. However, Go must compile that function code to something semantically equivalentโ€”let's see what.

https://lu.sagebl.eu/notes/go-cas/
For all GO haters :) https://juli1.substack.com/p/why-i-fell-in-love-with-go

Nice quote and summary:
>Technologies like JavaScript or Go are like a good burger: itโ€™s an option that the majority understand and choose regularly. It may not be the most elegant option, but it does the job and allows us to focus on problems that matter.