|
|
|
|
|
by ilyt
1271 days ago
|
|
> I agree that structs should enforce using all fields Nah, enforcement would be a problem if you're just say making a protocol decoder, you might "just" write struct as defined by API but not need to use all of its fields, or not use it inside the package (say package that decodes some JSON then just returns a struct with it) I'd like go vet option for that tho as in some cases that would be useful. > or have provided some defaults at declaration Outright initializers would be nice vs New*() for any type that needs it and having developer to remember to call that |
|