veandco / go-sdl2

SDL2 binding for Go
https://godoc.org/github.com/veandco/go-sdl2
BSD 3-Clause "New" or "Revised" License
2.2k stars 218 forks source link

Simplify use of MessageBoxData #389

Closed gonutz closed 5 years ago

gonutz commented 5 years ago

The C version of MessageBoxData has a button pointer and a button length. In Go we have a slice of buttons and an extra button length which is unnecessary because in Go we know a slice's length. I removed the extra integer. This makes the code easier to use. It is not Go-like to provide the length of a slice separately. This is error-prone. Additionally I changed the comments around, leaving only the relevant information, removing some noise.

veeableful commented 5 years ago

Thanks @gonutz! I guess this should be fine seeing we don't require it to be ABI-compatible. Merged!