templatecheck icon indicating copy to clipboard operation
templatecheck copied to clipboard

handle reflect.Value

Open josharian opened this issue 2 years ago • 2 comments

I was really excited to find this project. I gave it a test whirl and immediately ran into this:

template: REDACTED:10:49: checking "REDACTED" at <.Classes>: can't use field Classes in type reflect.Value

We make fairly extensive use of FuncMaps that return reflect.Values, generated by https://github.com/josharian/tstruct.

josharian avatar Oct 03 '23 21:10 josharian

(And to be clear, the template in question works correctly at execution time. The reflect.Value in question holds a struct with a Classes field.)

josharian avatar Oct 03 '23 21:10 josharian

https://github.com/josharian/tstruct/pull/5 mostly works around this problem.

josharian avatar Oct 03 '23 23:10 josharian