Marking a struct field of type time.Time as json omitempty has no effect. You must use a *time.Time for it to work (which is wire compatible). Vet should detect this situation and perhaps suggest *time.Time instead.
This might be reasonably extended to any struct type; see the linked omitzero proposals for more discussion. If an omitzero proposal is accepted, vet could switch to suggesting the use of omitzero rather than suggesting a pointer type.
cc @dsnet @robpike @dominikh
Marking a struct field of type
time.Timeas json omitempty has no effect. You must use a*time.Timefor it to work (which is wire compatible). Vet should detect this situation and perhaps suggest*time.Timeinstead.This might be reasonably extended to any struct type; see the linked omitzero proposals for more discussion. If an omitzero proposal is accepted, vet could switch to suggesting the use of omitzero rather than suggesting a pointer type.
cc @dsnet @robpike @dominikh