🇺🇦 Go на двоих


Гео и язык канала: Украина, Русский
Категория: Технологии


Канал о трюках и инженерных практиках на языке программирования Go за чашкой кофе ☕️.
Автор: @a_soldatenko
Сайт: https://asoldatenko.org
#golang #go

Связанные каналы  |  Похожие каналы

Гео и язык канала
Украина, Русский
Категория
Технологии
Статистика
Фильтр публикаций


TIL: strings.Split returns [""] if s does not contain sep and sep is not empty 😅

package main

import (
"fmt"
"strings"
)

func main() {
fmt.Printf("%q\n", strings.Split("", ","))
}

Split returns a slice of length 1 whose only element is s:

[""]










Old but still worth to read about why one shouldn;t defer Close() on writable files:

https://www.joeshaw.org/dont-defer-close-on-writable-files/




What do you think if I start posting not only about Golang, but some related topics like k8s/containers?
Опрос
  •   Yes
  •   No
  •   Strong Yes
  •   i don't care
238 голосов


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.
















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/


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!





Показано 20 последних публикаций.

1 212

подписчиков
Статистика канала