Simple example to demonstrate one way of checking for collisions of a moving rectangle inside a border by creating Vector2 points for each corner.
Code is here: https://unklnik.com/posts/2d-vector2-...
View on GitHub: https://github.com/unklnik/raylib-go-...
More examples using Go and Raylib are available here:
https://github.com/unklnik/raylib-go-...
Go https://go.dev/
Raylib-Go https://github.com/gen2brain/raylib-go
Raylib https://www.raylib.com/