go-gl / gl

Go bindings for OpenGL (generated via glow)
MIT License
1.09k stars 73 forks source link

unsafe usage of reflect.SliceHeader #132

Open hajimehoshi opened 3 years ago

hajimehoshi commented 3 years ago

https://github.com/go-gl/gl/blob/master/v2.1/gl/conversions.go#L94-L106

Go1.16's go vet warns this reflect.SliceHeader usage. See also https://golang.org/pkg/unsafe/

In general, reflect.SliceHeader and reflect.StringHeader should be used only as reflect.SliceHeader and reflect.StringHeader pointing at actual slices or strings, never as plain structs. A program should not declare or allocate variables of these struct types.