liquid icon indicating copy to clipboard operation
liquid copied to clipboard

Make tagKey an exported var to be able to use another struct tag

Open abemedia opened this issue 3 years ago • 0 comments

Checklist

  • [x] I have searched the issue list
  • [ ] I have tested my example against Shopify Liquid. (This isn't necessary if the actual behavior is a panic, or an error for which IsTemplateError returns false.)

Detailed Description

I want to be able to use liquid on structs from other packages, where I have no control over the struct tags. Specifically I'd like to use the json tag.

Possible Solution

Amend the tagKey constant to be an exported var: https://github.com/osteele/liquid/blob/d27c839ae38179600b71fa4ea504b6cb689c992f/values/structvalue.go#L66

abemedia avatar Feb 07 '22 18:02 abemedia