blog/content/posts/2022-05-31-golang-1.md
NeonXP 84b8eb8742
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
Добавил архивные посты
2024-01-03 17:39:08 +03:00

29 lines
1.5 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
title: "Golang подборка 1"
date: 2022-05-31T01:00:00+03:00
tags: ["it", "go"]
---
Просто собираю подборку интересных ссылок по гошке на почитать потом.
![Golang links](/img/go.jpg)
* [Extra](https://github.com/neonxp/extra) - Моё. Пакет с разными полезными функциями без дополнительных зависимостей.
* [Серия видосов про создание игры в стиле Animal Crossing на golang с помощью raylib](https://www.youtube.com/watch?v=iWp-mCIQgMU&list=PLVotA8ycjnCsy30WQCwVU5RrZkt4lLgY5&index=1)
* [Самописный распределенный типа Postgres](https://notes.eatonphil.com/distributed-postgres.html). Под капотом raft от hashicorp, boltdb и самое интересное - парсинг SQL
* Рассчет расстояния между двумя Geo точками:
```go
import "math"
...
// https://en.wikipedia.org/wiki/Haversine_formula
func GetDistance(lat1, lon1, lat2, lon2 float64) float64 {
lat1 *= math.Pi / 180
lon1 *= math.Pi / 180
lat2 *= math.Pi / 180
lon2 *= math.Pi / 180
return 12742 * math.Asin(math.Sqrt(math.Pow(math.Sin((lat2-lat1)/2), 2)+math.Cos(lat1)*math.Cos(lat2)*math.Pow(math.Sin((lon2-lon1)/2), 2)))
}
```
* [god](https://github.com/pioz/god) - Утилита подгатавливающая демоны из go программы. Для меня ценное - что генерит systemd конфиги.