🇺🇦 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
加入频道
Forwarded from Max
Друзі! Ви, напевно, пам'ятаєте, як я робив збори для хлопців із ЗСУ та інших підрозділів. Хлопців, яких знаю особисто.

Не так давно ми разом з вами вже зробили велику справу — зібрали на два Mavic 3 Combo, Starlink і інші, не меньш важливі на війні штуки. Військові за це ДУЖЕ вдячні вам всім! Але добрих справ в такий час не буває забагато.

Маємо запит на автівку для наших воїнів ССО. Ціль — 260 000 гривень. Допоможемо хлопцям створити для окупанта пекло на нашiй землі.

Кожна гривня, кожен репост — ще один крок до нашої перемоги. Дуже вам вдячний!

🔗Посилання на банку
https://send.monobank.ua/jar/13NzQaQmS

💳Номер картки банки
5375 4112 0530 6157

Paypal: [email protected]
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.