Note about cuelang
Недавно нашел интересный проект CUElang [1] (естественно написанный на Go).
Расшифровывается как Configure, Unify, Execute. Cue - это язык для конфигураций со встроенной проверкой типов. Вообщем, выглядит как попытка улучшить ситуацию с тем адом из yaml файлов, который сейчас есть.
Tl;dr чтобы быстро понять что к чему, можно пройти туториал [2], в котором предлагается перевести k8s *yaml файлы на *cue с валидацией и блэкджеком.
Так же есть смысл познакомиться с концепциями [3]. Из приятного, то что сразу есть консольная утилита
P.S. выглядит примерно так:
[1] https://github.com/cuelang/cue
[2] https://github.com/cuelang/cue/blob/v0.2.2/doc/tutorial/kubernetes/README.md
[3] https://cuelang.org/docs/concepts/logic/
[4] https://github.com/cuelang/cue/blob/master/doc/cmd/cue.md
Недавно нашел интересный проект CUElang [1] (естественно написанный на Go).
Расшифровывается как Configure, Unify, Execute. Cue - это язык для конфигураций со встроенной проверкой типов. Вообщем, выглядит как попытка улучшить ситуацию с тем адом из yaml файлов, который сейчас есть.
Tl;dr чтобы быстро понять что к чему, можно пройти туториал [2], в котором предлагается перевести k8s *yaml файлы на *cue с валидацией и блэкджеком.
Так же есть смысл познакомиться с концепциями [3]. Из приятного, то что сразу есть консольная утилита
cue
, которая умеет например форматировать cue файлы =), больше инфы тут [4]. P.S. выглядит примерно так:
$ cat <<EOF > foo.yaml
kind: Service
name: booster
EOF
# include the parsed file as an emit value:
$ cue import foo.yaml
$ cat foo.cue
{
kind: Service
name: booster
}
[1] https://github.com/cuelang/cue
[2] https://github.com/cuelang/cue/blob/v0.2.2/doc/tutorial/kubernetes/README.md
[3] https://cuelang.org/docs/concepts/logic/
[4] https://github.com/cuelang/cue/blob/master/doc/cmd/cue.md
GitHub
GitHub - cuelang/cue: CUE has moved to https://github.com/cue-lang/cue
CUE has moved to https://github.com/cue-lang/cue. Contribute to cuelang/cue development by creating an account on GitHub.
Go blogs
1 A Journey With Go https://medium.com/a-journey-with-go
2 Applied Go https://appliedgo.net
3 Ardan Labs’ Blog https://ardanlabs.com/blog
4 Dave Cheney’s Blog https://dave.cheney.net
5 DEV’s Go Tag https://dev.to/t/go
6 Digital Ocean’s Go Series https://digitalocean.com/community/tutorial_series/how-to-code-in-go
7 Eli Bendersky’s Blog https://eli.thegreenplace.net/tag/go
8 Go By Example https://gobyexample.com
9 Go Web Examples https://gowebexamples.com
10 Go’s Articles Wiki https://github.com/golang/go/wiki/Articles
11 Golang Bot https://golangbot.com
12 Golang Programs https://golangprograms.com
13 GolangCode https://golangcode.com
14 Gopher Academy Blog https://blog.gopheracademy.com
15 Gopher Guides https://gopherguides.com/articles
16 Hashnode’s Go Tag https://hashnode.com/n/go
17 Ilija Eftimov’s Blog https://ieftimov.com
18 ITNEXT’s Blog https://itnext.io/tagged/golang
19 Just For Func https://medium.com/justforfunc
20 Learn The Go Programming Language https://medium.com/learning-the-go-programming-language
21 Official Go Blog https://blog.golang.org
22 Russ Cox’s Blog https://research.swtch.com
23 Tit Petric’s Blog https://scene-si.org
24 Tutorial Edge https://tutorialedge.net/course/golang
25 Thoughts’ Go Topic https://utcc.utoronto.ca/~cks/space/blog/__TopicGoWandering
from reddit comments (https://www.reddit.com/r/golang/comments/kul1hd/go_blogs_rated_by_consistency_writing_quality_and/):
Jon Calhoun's Blog https://www.calhoun.io/
Bojan Živanović's Blog https://bojanz.github.io/
Jack Christensen's Blog https://www.jackchristensen.com/
Matt Layher's https://mdlayher.com/blog/
Johan Brandhorst-Satzkorn's Blog https://jbrandhorst.com/
Filippo Valsorda's Blog https://blog.filippo.io/
Peter Bourgon's Blog https://peter.bourgon.org/blog/
Other:
https://github.com/sanmak/awesome-blogs
https://www.mohitkhare.com/categories/golang
Если читаете что-то еще пишите в комменты :)
happy Monday!
1 A Journey With Go https://medium.com/a-journey-with-go
2 Applied Go https://appliedgo.net
3 Ardan Labs’ Blog https://ardanlabs.com/blog
4 Dave Cheney’s Blog https://dave.cheney.net
5 DEV’s Go Tag https://dev.to/t/go
6 Digital Ocean’s Go Series https://digitalocean.com/community/tutorial_series/how-to-code-in-go
7 Eli Bendersky’s Blog https://eli.thegreenplace.net/tag/go
8 Go By Example https://gobyexample.com
9 Go Web Examples https://gowebexamples.com
10 Go’s Articles Wiki https://github.com/golang/go/wiki/Articles
11 Golang Bot https://golangbot.com
12 Golang Programs https://golangprograms.com
13 GolangCode https://golangcode.com
14 Gopher Academy Blog https://blog.gopheracademy.com
15 Gopher Guides https://gopherguides.com/articles
16 Hashnode’s Go Tag https://hashnode.com/n/go
17 Ilija Eftimov’s Blog https://ieftimov.com
18 ITNEXT’s Blog https://itnext.io/tagged/golang
19 Just For Func https://medium.com/justforfunc
20 Learn The Go Programming Language https://medium.com/learning-the-go-programming-language
21 Official Go Blog https://blog.golang.org
22 Russ Cox’s Blog https://research.swtch.com
23 Tit Petric’s Blog https://scene-si.org
24 Tutorial Edge https://tutorialedge.net/course/golang
25 Thoughts’ Go Topic https://utcc.utoronto.ca/~cks/space/blog/__TopicGoWandering
from reddit comments (https://www.reddit.com/r/golang/comments/kul1hd/go_blogs_rated_by_consistency_writing_quality_and/):
Jon Calhoun's Blog https://www.calhoun.io/
Bojan Živanović's Blog https://bojanz.github.io/
Jack Christensen's Blog https://www.jackchristensen.com/
Matt Layher's https://mdlayher.com/blog/
Johan Brandhorst-Satzkorn's Blog https://jbrandhorst.com/
Filippo Valsorda's Blog https://blog.filippo.io/
Peter Bourgon's Blog https://peter.bourgon.org/blog/
Other:
https://github.com/sanmak/awesome-blogs
https://www.mohitkhare.com/categories/golang
Если читаете что-то еще пишите в комменты :)
happy Monday!
🇺🇦 Go for two :)
Go blogs 1 A Journey With Go https://medium.com/a-journey-with-go 2 Applied Go https://appliedgo.net 3 Ardan Labs’ Blog https://ardanlabs.com/blog 4 Dave Cheney’s Blog https://dave.cheney.net 5 DEV’s Go Tag https://dev.to/t/go 6 Digital Ocean’s Go Series…
к этому списку я бы еще добавил -> https://github.com/enocom/gopher-reading-list
GitHub
GitHub - enocom/gopher-reading-list: A curated selection of blog posts on Go
A curated selection of blog posts on Go. Contribute to enocom/gopher-reading-list development by creating an account on GitHub.
Нашел интересный проект Fortio, начиналась как инструмент нагрузочного тестирования для service mesh Istio, а теперь превратилась в собственный проект.
Написан естественно на Go и поставляется также в докере размером 3Mb, умеет считать сразу персентили и показывать результаты в небольшой веб страничке.
Больше деталей в README.md https://github.com/fortio/fortio
P.S.
Добавил по традиции в https://github.com/andriisoldatenko/awesome-performance-testing.
Если вы знаете еще какие-то performance тулы дайте знать в комментах либо можно сразу PR.
Написан естественно на Go и поставляется также в докере размером 3Mb, умеет считать сразу персентили и показывать результаты в небольшой веб страничке.
Больше деталей в README.md https://github.com/fortio/fortio
P.S.
Добавил по традиции в https://github.com/andriisoldatenko/awesome-performance-testing.
Если вы знаете еще какие-то performance тулы дайте знать в комментах либо можно сразу PR.
GitHub
GitHub - fortio/fortio: Fortio load testing library, command line tool, advanced echo server and web UI in go (golang). Allows…
Fortio load testing library, command line tool, advanced echo server and web UI in go (golang). Allows to specify a set query-per-second load and record latency histograms and other useful stats. -...
go-internals is a work-in-progress book about the internals of the Go (1.10+) programming language.
Автор правда забил 3 года назад, но то что есть очень интересное чтиво.
https://github.com/teh-cmc/go-internals
Автор правда забил 3 года назад, но то что есть очень интересное чтиво.
https://github.com/teh-cmc/go-internals
GitHub
GitHub - teh-cmc/go-internals: A book about the internals of the Go programming language.
A book about the internals of the Go programming language. - teh-cmc/go-internals
gitbatch утилита для управления сразу несколькими git репозиториями)
tl;dr https://asciinema.org/a/lxoZT6Z8fSliIEebWSPVIY8ct
https://github.com/isacikgoz/gitbatch
tl;dr https://asciinema.org/a/lxoZT6Z8fSliIEebWSPVIY8ct
https://github.com/isacikgoz/gitbatch
Вот интересный твит трэд от Даниэля об изменения в go 1.17 (который выйдет через 7 месяцев):
https://twitter.com/mvdan_/status/1352194794064392192?s=20
https://twitter.com/mvdan_/status/1352194794064392192?s=20
Twitter
Daniel Martí
Here's a short list of the changes to look forward to for #golang 1.17, to start landing once the merge window opens in a few weeks. Don't get confused with 1.16, releasing next month. 1.17 will come out in seven months. Each change with a link, so you can…
Если вы интересуетесь eBPF, то вот вам примеры от Leo создателя Falco.
https://github.com/leodido/go-ebpf-examples
P.S. под капотом тот самый https://github.com/iovisor/gobpf о котором я писал уже ранее -> https://yangx.top/golang_for_two/96
https://github.com/leodido/go-ebpf-examples
P.S. под капотом тот самый https://github.com/iovisor/gobpf о котором я писал уже ранее -> https://yangx.top/golang_for_two/96
GitHub
GitHub - leodido/go-ebpf-examples
Contribute to leodido/go-ebpf-examples development by creating an account on GitHub.
FOSDEM 2021 Go dev room
В этом году FOSDEM пройдет online, в субботу 6 февраля!
И уже есть расписание https://fosdem.org/2021/schedule/track/go/
В этом году FOSDEM пройдет online, в субботу 6 февраля!
И уже есть расписание https://fosdem.org/2021/schedule/track/go/
archive.fosdem.org
FOSDEM 2021 - Go devroom
Интересный трэд [1] от Matthew Dempsky о runtime баге [2]:
Links:
[1] https://twitter.com/mdempsky/status/1353999359537364993?s=21
[2] https://github.com/golang/go/issues/43921("recover does not correctly recover from panic")
Links:
[1] https://twitter.com/mdempsky/status/1353999359537364993?s=21
[2] https://github.com/golang/go/issues/43921("recover does not correctly recover from panic")
Twitter
Matthew Dempsky
Wrote a fuzzer for testing defer/panic/recover, and it's already finding runtime crashes: https://t.co/pdYHh7VePZ
Всем известный Ben Johnson, он же автор BoltDB сегодня зарелизил новый проект Litestream.
Litestream - инструмент потоковой (stream) репликации для SQLite. Он работает как фоновый процесс и безопасно реплицирует частичные изменения в другой файл или AWS S3. Litestream взаимодействует с SQLite только через API SQLite, поэтому он безопасен для ваших данных.
Как обычно фидбэк в твиттер автору: https://twitter.com/benbjohnson/status/1354468790558281731
Ссылка на код: https://github.com/benbjohnson/litestream
Litestream - инструмент потоковой (stream) репликации для SQLite. Он работает как фоновый процесс и безопасно реплицирует частичные изменения в другой файл или AWS S3. Litestream взаимодействует с SQLite только через API SQLite, поэтому он безопасен для ваших данных.
Как обычно фидбэк в твиттер автору: https://twitter.com/benbjohnson/status/1354468790558281731
Ссылка на код: https://github.com/benbjohnson/litestream
Twitter
Ben Johnson
I've been iterating a streaming SQLite tool for over a year. I'm finally releasing Litestream as beta! You can now safely run fast, single-node applications that continuously backup to S3. I'd love feedback and leave a star if you find it interesting! ht…
Сегодня зарелизился Delve v1.6.0
Из важных изменений:
- Go 1.16 support, Apple M1 support, syntax highlighting for code blocks, and more!
Из важных изменений:
- Go 1.16 support, Apple M1 support, syntax highlighting for code blocks, and more!
dlv versionПолный CHANGELOG -> https://github.com/go-delve/delve/blob/master/CHANGELOG.md#160-2021-01-28
Delve Debugger
Version: 1.6.0
Build: 75485427957fba167a6eaca76b1ee9549d62916f
GitHub
delve/CHANGELOG.md at master · go-delve/delve
Delve is a debugger for the Go programming language. - go-delve/delve
🇺🇦 Go for two :)
FOSDEM 2021 Go dev room В этом году FOSDEM пройдет online, в субботу 6 февраля! И уже есть расписание https://fosdem.org/2021/schedule/track/go/
Видео начали заливать https://twitter.com/maartjeme/status/1358101853955883008?s=21
Twitter
Maartje Eyskens 😷
Did you just wake up and missed the #golang devroom? Don't cry All talks are at https://t.co/3s8DCKkZmP just 2 live ones missing but they will be there soon!
Интересный тред о том по каким материалам готовится к собеседованию по Golang:
https://twitter.com/Randomazer/status/1370109404679442432
https://twitter.com/Randomazer/status/1370109404679442432
Twitter
Randomazer
Хотел запилить тред о том по каким материалам готовится к собеседованию по Golang, но что то сегодня так упыхался. Перенесу на завтра. С вас лайки - с меня завтра тред.
Performance comparison: counting words in Python, Go, C++, C, AWK, Forth, and Rust
https://benhoyt.com/writings/count-words/
https://benhoyt.com/writings/count-words/
Benhoyt
Performance comparison: counting words in Python, Go, C++, C, AWK, Forth, and Rust
Performance comparison of counting and sorting word frequencies in various languages (Python, Go, C++, C, AWK, Forth, and Rust)
Automatically Detecting and Fixing Concurrency Bugs in Go
Software Systems
https://songlh.github.io/paper/gcatch.pdf
Также у автора есть интересный репозиторий https://github.com/system-pclub/go-concurrency-bugs
Ну и список багов
https://docs.google.com/spreadsheets/d/1mDxB6IRxrTodF9CrmpUu72E6673y5s9BkjKuTjtx1qc/edit#gid=0
подсмотрел у https://twitter.com/dgryski
Software Systems
https://songlh.github.io/paper/gcatch.pdf
Также у автора есть интересный репозиторий https://github.com/system-pclub/go-concurrency-bugs
Ну и список багов
https://docs.google.com/spreadsheets/d/1mDxB6IRxrTodF9CrmpUu72E6673y5s9BkjKuTjtx1qc/edit#gid=0
подсмотрел у https://twitter.com/dgryski
golang deep comparison for testing:
https://github.com/maxatome/go-testdeep
можно переписать в:
P.S. в проде не юзал но выглядит аккуратно, особенно когда происходит расхождение с ожидаемым результатом.
https://github.com/maxatome/go-testdeep
import (
"testing"
"time"
)
func TestCreateRecord(t *testing.T) {
before := time.Now().Truncate(time.Second)
record, err := CreateRecord()
if err != nil {
t.Errorf("An error occurred: %s", err)
} else {
expected := Record{Name: "Bob", Age: 23}
if record.Id == 0 {
t.Error("Id probably not initialized")
}
if before.After(record.CreatedAt) ||
time.Now().Before(record.CreatedAt) {
t.Errorf("CreatedAt field not expected: %s", record.CreatedAt)
}
if record.Name != expected.Name {
t.Errorf("Name field differs, got=%s, expected=%s",
record.Name, expected.Name)
}
if record.Age != expected.Age {
t.Errorf("Age field differs, got=%s, expected=%s",
record.Age, expected.Age)
}
}
}
можно переписать в:
import (
"testing"
"time"
"github.com/maxatome/go-testdeep/td"
)
func TestCreateRecord(t *testing.T) {
before := time.Now().Truncate(time.Second)
record, err := CreateRecord()
if td.CmpNoError(t, err) {
td.Cmp(t, record.Id, td.NotZero(), "Id initialized")
td.Cmp(t, record.Name, "Bob")
td.Cmp(t, record.Age, 23)
td.Cmp(t, record.CreatedAt, td.Between(before, time.Now()))
}
}
P.S. в проде не юзал но выглядит аккуратно, особенно когда происходит расхождение с ожидаемым результатом.
GitHub
GitHub - maxatome/go-testdeep: Extremely flexible golang deep comparison, extends the go testing package, tests HTTP APIs and provides…
Extremely flexible golang deep comparison, extends the go testing package, tests HTTP APIs and provides tests suite - maxatome/go-testdeep
A Golang library for generating high-entropy random passwords similar to 1Password or LastPass.
Example passwords this library may generate:
https://github.com/sethvargo/go-password
Из интересного сразу идет моком для тестов:
Example passwords this library may generate:
0N[k9PhDqmmfaO`p_XHjVv`HTq|zsH4XiH8umjg9JAGJ#\Qm6lZ,28XF4{X?3sHj
7@90|0H7!4p\,c<!32:)0.9N
UlYuRtgqyWEivlXnLeBpZvIQ
Q795Im1VR5h363s48oZGaLDa
wpvbxlsc
https://github.com/sethvargo/go-password
Из интересного сразу идет моком для тестов:
// func MyFunc(p *password.Generator)
func MyFunc(p password.PasswordGenerator) {
// ...
}
func TestMyFunc(t *testing.T) {
gen := password.NewMockGenerator("canned-response", false)
MyFunc(gen)
}
GitHub
GitHub - sethvargo/go-password: A Golang library for generating high-entropy random passwords similar to 1Password or LastPass.
A Golang library for generating high-entropy random passwords similar to 1Password or LastPass. - sethvargo/go-password