Исключения в Go (NSFW): https://play.golang.org/p/LXroobH8SM
via https://www.reddit.com/r/golang/comments/n1q948/so_you_want_to_use_trycatch/
via https://www.reddit.com/r/golang/comments/n1q948/so_you_want_to_use_trycatch/
Reddit
reddit.com: over 18?
Reddit gives you the best of the internet in one place. Get a constantly updating feed of breaking news, fun stories, pics, memes, and videos just for you. Passionate about something niche? Reddit has thousands of vibrant communities with people that share…
https://github.com/golang/go/issues/45955
https://github.com/golang/go/wiki/SliceTricks скоро будет не нужен 🎉
https://github.com/golang/go/wiki/SliceTricks скоро будет не нужен 🎉
GitHub
slices: new package to provide generic slice functions · Issue #45955 · golang/go
Note: Discussion is now at #47203. This proposal is for use with #43651. We propose defining a new package, slices, that will provide functions that may be used with slices of any type. If this pro...
Чем я занимаюсь на работе (вернее, пока ещё только пытаюсь): https://thenewstack.io/shell-less-kubernetes-talos-systems-introduces-the-common-operating-system-interface/
The New Stack
Shell-less Kubernetes: Talos Systems Introduces the Common Operating System Interface
Its opinionated container-specific operating system (CSOS), Talos OS, is driven entirely by application programming interfaces (API)s. And, now Talos wants to standardize what an API-driven OS should like under the new Common Operating System Interface (COSI)…
Давно хотел такого: https://github.com/golang/go/issues/46273
GitHub
proposal: context: add WithCancelReason · Issue #46273 · golang/go
Would you consider yourself a novice, intermediate, or experienced Go programmer? I'd say experienced What other languages do you have experience with? C++, Javascript, Python, PHP Would th...
sync.Mutex.TryLock
всё-таки будет: https://github.com/golang/go/issues/45435#issuecomment-853265255Очень надеюсь, что сообщество воспримет этот метод как в своё время восприняли type alias’ы – специализированное средство для специализированных случаев, и не будет использовать его где попало. Лично мне, за много лет использования Go, ни разу
TryLock
не понадобился – всегда дизайн с каналами и select
был легче для понимания.GitHub
sync: add Mutex.TryLock · Issue #45435 · golang/go
What version of Go are you using (go version)? $ go version go version go1.16.3 darwin/amd64 Does this issue reproduce with the latest release? Yes What operating system and processor architecture ...
Forwarded from oleg_log (Oleg Kovalov)
1.16.5 и 1.15.13 вышли, math/big, net/http/httputil & archive/zip пофиксили. Прям как-то много даже, не помню таких объемных патч версий за последнее время.
https://groups.google.com/g/golang-announce/c/RgCMkAEQjSI/m/r_EP-NlKBgAJ
https://groups.google.com/g/golang-announce/c/RgCMkAEQjSI/m/r_EP-NlKBgAJ
Встроенная поддержка fuzzing’а в Go вышла в бету, но, к сожалению, не войдёт в Go 1.17. Эх. https://blog.golang.org/fuzz-beta
Если вы включаете fuzzing в свой CI (а вы должны), то можно сэкономить немного времени пользуясь уже собранной веткой
Если вы включаете fuzzing в свой CI (а вы должны), то можно сэкономить немного времени пользуясь уже собранной веткой
dev.fuzz
: https://github.com/AlekSi/golang-tipgo.dev
Fuzzing is Beta Ready - The Go Programming Language
Native Go fuzzing is now ready for beta testing on tip.
Новый компилятор protobuf’а, духовный наследник gogoprotobuf: https://vitess.io/blog/2021-06-03-a-new-protobuf-generator-for-go/
Vitess
Vitess | A new Protocol Buffers generator for Go
Go на голом ARM железе, без ядра Linux: https://github.com/golang/go/issues/46802
GitHub
proposal: all: add bare metal ARM support · Issue #46802 · golang/go
Hello, I'd like to request reconsideration of our previous proposal (declined) as there have been new simplifications in our patch that should solve some, if not all, concerns previously ra...
Go 1.17 is deprecating the traditional use of
На мой взгляд – хорошее изменение. Разное поведение
go get
: https://utcc.utoronto.ca/~cks/space/blog/programming/GoAndDeprecatingGoGetНа мой взгляд – хорошее изменение. Разное поведение
go get
внутри проекта с модулями и вне его было очень странным. Но да, старые инструкции нужно обновить.False positive в двух действиях, или
В Go есть тикеты про vet check (сложно) и про исправление range (мифический Go 2).
paralleltest
linter ругается и на корректный, и на некорректный код: https://github.com/kunwardeep/paralleltest/issues/8#issuecomment-871118330В Go есть тикеты про vet check (сложно) и про исправление range (мифический Go 2).
GitHub
Range statement for test ... does not use range value in t.Run linter is not always correct · Issue #8 · kunwardeep/paralleltest
Following piece of code currently triggers the linter, even though it is a valid code. package main import ( "fmt" "testing" ) func TestFunctionRangeNotUsingRangeValueInTDotRun(...
Загадка:
—
Отгадка: https://github.com/golang/go/issues/27900
—
$ go list all | grep k8s.io/kubernetes
$ go list -m all | grep k8s.io/kubernetes
k8s.io/kubernetes v1.13.0
$ go mod why k8s.io/kubernetes
# k8s.io/kubernetes
(main module does not need package k8s.io/kubernetes)
—Отгадка: https://github.com/golang/go/issues/27900
Оказывается, спецификация протокола MongoDB распространяется под лицензией СС Attribution-NonCommercial-ShareAlike, прямо запрещающей коммерческое использование, включая создание коммерческих СУБД и DBaaS’ов. Недавно они написали об этом явно: https://news.ycombinator.com/item?id=27908107 Но, как оказалось, эта лицензия была всегда.
Интересно, неужели Amazon DocumentDB и Azure CosmosDB делали чистую комнату?
Интересно, неужели Amazon DocumentDB и Azure CosmosDB делали чистую комнату?
Расс Кокс написал свои мысли про “make major versions optional in import paths”: https://github.com/golang/go/issues/44550#issuecomment-885324886
Но в этом большом вдумчивом сообщении мне больше всего понравился щелчок по носу Питеру Бургону:
> I have personally had what I consider to be substantial exposure to an enormous amount of Go code, due to my position in the OSS ecosystem, as well as my consulting work. That exposure includes, importantly, a huge amount of code maintained in private repositories. I have no way of knowing, but I suspect the only person in the Go community who may have seen more Go code than I have is Bill Kennedy. With that context, I can state without hesitation that the need to include two major versions of the same dependency in one compilation unit is extraordinarily rare, and in those rare circumstances that it does arise, it is almost always due to pathological conditions in the dependency graph.
This claim about needing multiple major versions being “extremely rare” is easily contradicted. Kubernetes depends on multiple major versions of github.com/russross/blackfriday and of gopkg.in/yaml. Even Peter's own Go-kit depends on both go.etcd.io/etcd/client/v2 and go.etcd.io/etcd/client/v3.
Но в этом большом вдумчивом сообщении мне больше всего понравился щелчок по носу Питеру Бургону:
> I have personally had what I consider to be substantial exposure to an enormous amount of Go code, due to my position in the OSS ecosystem, as well as my consulting work. That exposure includes, importantly, a huge amount of code maintained in private repositories. I have no way of knowing, but I suspect the only person in the Go community who may have seen more Go code than I have is Bill Kennedy. With that context, I can state without hesitation that the need to include two major versions of the same dependency in one compilation unit is extraordinarily rare, and in those rare circumstances that it does arise, it is almost always due to pathological conditions in the dependency graph.
This claim about needing multiple major versions being “extremely rare” is easily contradicted. Kubernetes depends on multiple major versions of github.com/russross/blackfriday and of gopkg.in/yaml. Even Peter's own Go-kit depends on both go.etcd.io/etcd/client/v2 and go.etcd.io/etcd/client/v3.
GitHub
proposal: cmd/go: make major versions optional in import paths · Issue #44550 · golang/go
Semantic Import Versioning (SIV) is a novel idea for supporting multiple versions of a package within the same program. To my knowledge and experience, it's the first example of a strategy for ...
А давно у https://staticcheck.io такой весёлый подзаголовок на сайте?
EDIT: Он ещё и меняется.
EDIT: Он ещё и меняется.
rm -rf $GOPATH
– лучший.