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
Docker Security Cheat Sheet:
RULE #0 - Keep Host and Docker up to date
RULE #1 - Do not expose the Docker daemon socket (even to the containers)
RULE #2 - Set a user
RULE #3 - Limit capabilities (Grant only specific capabilities, needed by a container)
RULE #4 - Add –no-new-privileges flag
RULE #5 - Disable inter-container communication (--icc=false)
RULE #6 - Use Linux Security Module (seccomp, AppArmor, or SELinux)
RULE #7 - Limit resources (memory, CPU, file descriptors, processes, restarts)
RULE #8 - Set filesystem and volumes to read-only
RULE #9 - Use static analysis tools
RULE #10 - Set the logging level to at least INFO
Rule #11 - Lint the Dockerfile at build time
more details about each rule: https://cheatsheetseries.owasp.org/cheatsheets/Docker_Security_Cheat_Sheet.html
Source: https://github.com/OWASP/CheatSheetSeries
RULE #0 - Keep Host and Docker up to date
RULE #1 - Do not expose the Docker daemon socket (even to the containers)
RULE #2 - Set a user
RULE #3 - Limit capabilities (Grant only specific capabilities, needed by a container)
RULE #4 - Add –no-new-privileges flag
RULE #5 - Disable inter-container communication (--icc=false)
RULE #6 - Use Linux Security Module (seccomp, AppArmor, or SELinux)
RULE #7 - Limit resources (memory, CPU, file descriptors, processes, restarts)
RULE #8 - Set filesystem and volumes to read-only
RULE #9 - Use static analysis tools
RULE #10 - Set the logging level to at least INFO
Rule #11 - Lint the Dockerfile at build time
more details about each rule: https://cheatsheetseries.owasp.org/cheatsheets/Docker_Security_Cheat_Sheet.html
Source: https://github.com/OWASP/CheatSheetSeries
cheatsheetseries.owasp.org
Docker Security - OWASP Cheat Sheet Series
Website with the collection of all the cheat sheets of the project.
Code Review Checklist: Go Concurrency
https://github.com/code-review-checklists/go-concurrency
идет как дополнение к https://github.com/golang/go/wiki/CodeReviewComments
https://github.com/code-review-checklists/go-concurrency
идет как дополнение к https://github.com/golang/go/wiki/CodeReviewComments
GitHub
GitHub - code-review-checklists/go-concurrency: Checklist for code reviews
Checklist for code reviews. Contribute to code-review-checklists/go-concurrency development by creating an account on GitHub.
Practical Go Lessons Book
https://www.practical-go-lessons.com/
По словам автора, он начал писать эту книгу в 2018 по ночам и по выходным, а в конце 2020 года уволился с основной работы и начал писать книгу фул тайм 😱. Огромный респект автору.
Книга подходит больше новичкам, мне очень понравились иллюстрации которых очень много! [405 штук]
https://www.practical-go-lessons.com/
По словам автора, он начал писать эту книгу в 2018 по ночам и по выходным, а в конце 2020 года уволился с основной работы и начал писать книгу фул тайм 😱. Огромный респект автору.
Книга подходит больше новичкам, мне очень понравились иллюстрации которых очень много! [405 штук]
Kubernetes deployment strategies
Коротко о том какие в k8s есть стратегии деплоя с примерами:
https://github.com/ContainerSolutions/k8s-deployment-strategies
tl;dr:
* recreate: terminate the old version and release the new one
* ramped: release a new version on a rolling update fashion, one after the other
* blue/green: release a new version alongside the old version then switch traffic
* canary: release a new version to a subset of users, then proceed to a full rollout
* a/b testing: release a new version to a subset of users in a precise way (HTTP headers, cookie, weight, etc.). This doesn’t come out of the box with Kubernetes, it imply extra work to setup a smarter loadbalancing system (Istio, Linkerd, Traeffik, custom nginx/haproxy, etc).
* shadow: release a new version alongside the old version. Incoming traffic is mirrored to the new version and doesn't impact the response.
Коротко о том какие в k8s есть стратегии деплоя с примерами:
https://github.com/ContainerSolutions/k8s-deployment-strategies
tl;dr:
* recreate: terminate the old version and release the new one
* ramped: release a new version on a rolling update fashion, one after the other
* blue/green: release a new version alongside the old version then switch traffic
* canary: release a new version to a subset of users, then proceed to a full rollout
* a/b testing: release a new version to a subset of users in a precise way (HTTP headers, cookie, weight, etc.). This doesn’t come out of the box with Kubernetes, it imply extra work to setup a smarter loadbalancing system (Istio, Linkerd, Traeffik, custom nginx/haproxy, etc).
* shadow: release a new version alongside the old version. Incoming traffic is mirrored to the new version and doesn't impact the response.
GitHub
GitHub - ContainerSolutions/k8s-deployment-strategies: Kubernetes deployment strategies explained
Kubernetes deployment strategies explained. Contribute to ContainerSolutions/k8s-deployment-strategies development by creating an account on GitHub.
23 апреля приглашаем всех гоферов на GopherCon Russia 2021: online, бесплатно, лучшие доклады, стенды партнёров, горячие споры в чатах! Среди спикеров этого года Mat Ryer, Aaron Schlesinger и Felix Geisendörfer. А для тех, кто хочет не только пообщаться и послушать доклады, но и прокачать свои навыки на практике, подготовили 4 воркшопа: Kubernetes-операторы, линтеры с ruleguard, профилирование и оптимизация, Fuzz и Property-Based тесты. Все подробности регистрация на https://www.gophercon-russia.ru/
www.gophercon-russia.ru
GopherCon Russia 2021
Конференция разработчиков на Go, 23-25 апреля 2021 года, Online.