Путём ручного удаления тысяч строк кода нашёл эпичный баг в Go. И задумался — а есть ли инструменты для автоматического уменьшения примеров, воспроизводящих проблему? Если нет, то как сложно такой сделать? Чтобы не просто упрощать код, а прямо удалять его, пока проблема воспроизводится.
Заменил
на
и заплакал
var dbFound bool
for _, d := range dbs {
if d == db {
dbFound = true
break
}
}
на
dbFound := slices.Contains(dbs, db)
и заплакал
Всех с годом, когда в Go завезут дженерики!
🎉44🤩16😱13🔥10👎2
Crazy craziness, или что показать коллегам, которые думаю, что в Google работают боги:
https://github.com/google/gopacket/commit/4370cf9687c957859fefd7963611f49f23338357
https://github.com/google/gopacket/commit/4370cf9687c957859fefd7963611f49f23338357
GitHub
Add in comment for weird performance behavior. · google/gopacket@4370cf9
There was a ~20% performance regression introduced in commit
94584fa3c1db8c2a75741a1648d6fa16e9f32ccc. This commit adds a comment describing
the behavior.
94584fa3c1db8c2a75741a1648d6fa16e9f32ccc. This commit adds a comment describing
the behavior.
Despite using golang, working with the absolute impenetrable monster that is kubernetes (I refuse to believe anyone actually understands this tool), taking on a helpdesk like on-call experience for one week at a time tending to configuration files over code, and not touching C++ at all, I feel more rewarded in my work than I ever did writing any amount of C++ in my entire life.
C++ довёл человека до OCPD.
https://izzys.casa/2021/12/wrapping-up-2021/
C++ довёл человека до OCPD.
https://izzys.casa/2021/12/wrapping-up-2021/
Self Unemployed • Izzy Muerte
Wrapping Up 2021
2021 was not too kind to me. I discovered that I not only have OCD but OCPD, a
personality disorder. If you’ve ever had a conversation with me where I just
couldn’t let something go because it was wrong or incorrect and it bothered
me, now you know why. I…
personality disorder. If you’ve ever had a conversation with me where I just
couldn’t let something go because it was wrong or incorrect and it bothered
me, now you know why. I…
How to Go wrong
Crazy craziness, или что показать коллегам, которые думаю, что в Google работают боги: https://github.com/google/gopacket/commit/4370cf9687c957859fefd7963611f49f23338357
Если вы хотели спросить чего это это я первого января полез в gopacket… Что-то на моём Маке выкачало несколько гигабайт за полчаса через телефон в режиме модема, при этом в Activity Monitor’е ничего не было видно. Снял дамп Wireshark’ом, полез разбираться. Оказался какой-то косяк с iCloud /
Кроме этого забавного комментария – отличная библиотека, рекомендую.
nsurlsessiond
; перезагрузка помогла.Кроме этого забавного комментария – отличная библиотека, рекомендую.
👍2
12-ого выступаю с докладом на митапе GDG Berlin про FerretDB. Что бы вы хотели на нём узнать?
Meetup
Login to Meetup | Meetup
Not a Meetup member yet? Log in and find groups that host online or in person events and meet people in your local community who share your interests.
👍5
Казалось бы, разумно хотеть
go help environment
и go env
показывать все переменные окружения, влияющие на Go? https://github.com/golang/go/issues/50444GitHub
cmd/go: `GORACE`, `GOGC`, `GOMAXPROCS`, `GOTRACEBACK` are not documented in `go help environment` · Issue #50444 · golang/go
What version of Go are you using (go version)? Both 1.17.5 and the current tip. What did you do? Run go help environment. What did you expect to see? Documentation for all environment variables tha...
Кстати, вы знаете, что не так с кучей кода, делающей
edit: То, что
os.Getenv("GOPATH")
?edit: То, что
go env -w
влияет на команду go
и рантайм, но не на код, который забыл про этот флаг.Forwarded from ☕️ Мерлин заваривает τσάι 🐌
Готовьтесь обновлять гошечку на проде
https://github.com/golang/go/milestone/240
https://github.com/golang/go/milestone/240
Дженерики крутые, можно написать любую дженерик функцию. Давайте напишем дженерик функцию сравнения двух объектов через
Полчаса спустя…
И даже этого недостаточно для сравнения
Equal(T) bool
(если есть) или ==
.Полчаса спустя…
type Equaler[T any] interface { Equal(T) bool }
func Equal[T comparable](expected, actual T) bool { ... }
func EqualEqualers[T any](e1 Equaler[T], e2 T) bool { ... }
func EqualSlices[T comparable](s1, s2 []T) bool { ... }
func EqualMaps[M1, M2 ~map[K]V, K, V comparable](m1 M1, m2 M2) bool { ... }
И даже этого недостаточно для сравнения
map[string]net.IP
: net.IP
– слайс, а слайсы не comparable.LIBERTY LIBERTY LIBERTY, или о пользе Minimal Version Selection и Go Module Proxy
https://www.bleepingcomputer.com/news/security/dev-corrupts-npm-libs-colors-and-faker-breaking-thousands-of-apps/
https://www.bleepingcomputer.com/news/security/dev-corrupts-npm-libs-colors-and-faker-breaking-thousands-of-apps/
BleepingComputer
Dev corrupts NPM libs 'colors' and 'faker' breaking thousands of apps
Users of popular open-source libraries 'colors' and 'faker' were left stunned after they saw their applications, using these libraries, printing gibberish data and breaking. Some surmised if the NPM libraries had been compromised, but it turns out there's…
How to Go wrong
LIBERTY LIBERTY LIBERTY, или о пользе Minimal Version Selection и Go Module Proxy https://www.bleepingcomputer.com/news/security/dev-corrupts-npm-libs-colors-and-faker-breaking-thousands-of-apps/
Reuters
New York man arrested after apartment fire; explosive materials found
A New York City man was arrested early on Wednesday after he was injured in a fire at his apartment, where authorities later found chemicals that could be used to make bombs and instructions on how to make them, police said.
👍3😱2
Последние несколько недель в части интернета не прекращается дискуссия, косвенно связанная с новостями выше: как зарабатывать / нужно ли платить за open source. Хотел поделиться с вами постом, которые очень чётко отражает мою позицию и как мейнтейнера, и как CTO open source startup’а, и как автора канальчика в Telegram:
https://apenwarr.ca/log/20211229
(Если сравнение с коммунизмом вызывает у вас рвотные рефлексы, то можно эту часть пропустить без больших потерь)
https://apenwarr.ca/log/20211229
(Если сравнение с коммунизмом вызывает у вас рвотные рефлексы, то можно эту часть пропустить без больших потерь)
apenwarr.ca
The Gift of It's Your Problem Now
Recently a security hole in a certain open source Java library resulted in a worldwide emergency kerfuffle as, say, 40% of the possibly hund...
👍3
Forwarded from oleg_log (Oleg Kovalov)
The right path forward for NPM and package managers like it is to stop preferring the latest possible version of all dependencies when installing a new package. Instead, they should prefer to use the dependency versions that the package was actually tested with, or versions as close as possible to those. I call that a high-fidelity build.
https://research.swtch.com/npm-colors
https://research.swtch.com/npm-colors
👍5