* 'Mark' via golang-nuts <
golan...@googlegroups.com> [221201 05:17]:
> I tried that and it works in the playground, and I added more types and it
> still works in the playground <
https://go.dev/play/p/Yxzj4tAAGhM>.
> But in my program it still doesn't work:-(
> The actual code is here tdb-go <
https://github.com/mark-summerfield/tdb-go>
> in the file marshal.go from line 133 function marshalTableMetaData().
> If you run: go test it all works; but if you replace the call to hack() and
> use nullable as you did in the playground, some of the tests fail.
You don't show the code that doesn't work (i.e. with nullable). Did you
make a typo like you did in your code below?
> On Thursday, December 1, 2022 at 9:45:48 AM UTC kortschak wrote:
>
> > On Thu, 2022-12-01 at 00:33 -0800, 'Mark' via golang-nuts wrote:
> > > Thanks. I've now tried that as follows:
> > >
> > > fmt.Printf("@@@@@@: %T %v\n", field, field)
> > > kind = field.Type().Elem().Kind()
> > > fmt.Printf("######: %T %v\n", field, field)
Note that in both Printf statements, you are using field rather than
kind. If the two Printf's gave different results, I would consider it a
compiler bug (a really egregious one!).
> > > In every case the output for kind before and after was identical.
> > > (Naturally, I tried without the print statements too.) And, of course
> > > the tests fail. So I'm _still_ using the awful hack!
> > >
> >
> > Doesn't this do what you want?
> >
> >
https://go.dev/play/p/7jUw_iW8B_8
...Marvin