Golang can be very dynamically also without "reflect" package
My first ambition was to create a method where you can call a function dynamic with his ‘string’ name. The next step was to extend it so that it accepts all types as parameters. The examples show you:
How you can call a function by a name, how you can pass a different count of parameters with different types and how you can use these methods to build a general addition function and logger function. I hope i could encourage you to learn more about all the nice features behind golang and especially that you don ́t always falling back to "reflection" when you want to go dynamically.
Written by Dustin
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Dynamic
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#