google / uuid

Go package for UUIDs based on RFC 4122 and DCE 1.1: Authentication and Security Services.
BSD 3-Clause "New" or "Revised" License
5.24k stars 363 forks source link

About NullUUID MarshalText() output #90

Closed gandaldf closed 1 year ago

gandaldf commented 2 years ago

Is it right that MarshalText() function, if the input is not valid, returns the same output ([]byte("null")) as MarshalJSON() function?

https://github.com/google/uuid/blob/44b5fee7c49cf3bcdf723f106b36d56ef13ccc88/null.go#L85

Wouldn't it be better if it returned a[]byte{}? Thank you, and sorry if my question seems stupid.