You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I tried to adapt my enum package to the new v2 API, but I'm currently stuck on the json functions that only supports generic type parameters for defining custom marshalers/unmarshalers. Due to the dynamic discovery via reflect.Type, I can't instantiate the corresponding generic types.
It would only take a simple additional one-liner to also support a non-generic variant — similar to how the reflect package provides both TypeFor[T] and TypeOf(any).
The text was updated successfully, but these errors were encountered:
Hi, I recommend filing a proposal at https://github.com/golang/go/issues with the suggested API and tagging golang/go#71497 as the parent issue. Since this is API that could be added after the initial release of v2, I suspect that it will not be considered initially.
It seems to me that would need at least 4 additional functions to support this, which is somewhat unfortunate.
I tried to adapt my enum package to the new v2 API, but I'm currently stuck on the json functions that only supports generic type parameters for defining custom marshalers/unmarshalers. Due to the dynamic discovery via reflect.Type, I can't instantiate the corresponding generic types.
It would only take a simple additional one-liner to also support a non-generic variant — similar to how the reflect package provides both TypeFor[T] and TypeOf(any).
The text was updated successfully, but these errors were encountered: