manifoldco / go-manifold

Go client API for Manifold (unstable)
https://www.manifold.co
BSD 3-Clause "New" or "Revised" License
4 stars 1 forks source link

idtype: add TypeFromString. #40

Closed jelmersnoeck closed 6 years ago

jelmersnoeck commented 6 years ago

Sometimes, you have the string representation of a type and you want to make the actual type out of it. This implements such behaviour.

I chose not to add a k/v map with the string as key to save the memory footprint as the amount of times you would use this would not justify adding the extra map over the extra time to access the map values.