Open egonelbre opened 1 year ago
one of the things about the Field types is that the zero value is invalid (that's why there's both a _set and a _null), and you have to use the constructors to create values correctly. using embedding like this would negate that somewhat. it's also not very many lines of code saved.
Hmm, maybe there's a way to make something shorter? But, I was not able to come up with something shorter.
Maybe structs and delegating the field checks to lint time could work. i.e. get rid of the field types altogether.
There's a significant duplication of the field code:
Could be replaced by:
It's not clear how big the benefit is here. Also, maybe there's a better approach for this.