|
|
|
|
|
by CamouflagedKiwi
438 days ago
|
|
Because the order of fields can be significant. It's very relevant for syscalls, and is observable via the reflect package; it'd be strange if the field order was arbitrarily changed (and might change further between releases). I assume the thinking was that this is pretty easy to optimise if you care, and if it's on by default there'd then have to be some opt-out which there isn't a good mechanism for. |
|
Good is subjective, but the mechanism is something already implemented: https://pkg.go.dev/structs#HostLayout