For a student project I'm trying to build an interface between Project Cars 2 which has a shared memory address where you can collect car telemetry data, and an embedded system communicating over UART.
I'd like to build it in Go and in the long run make a package for Go that can communicate and collect telemetry data and use it in the future. The shared memory struct and data is written in C and found here (source of this file). When you access the memory mapped file "%pcars2%", this address contains the data in the organization of the linked struct.
My question is how's the best way to extract data from this struct? I understand I can use cgo and interpret the struct's data, but is there a way I could do a memory copy like in C directly in Go using a struct built from similar types from this address? I understand I can use the UDP API for telemetry data but am curious if Go has this sort of functionality.