29 lines
1.5 KiB
Markdown
29 lines
1.5 KiB
Markdown
---
|
||
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 конфиги.
|