Redability
Optional Parameters Using Option Struct
· ☕ 5 min read
There is another option to use optional parameter which we saw in last post. We use something called option struct. Much similar to what we do in JavaScript. Without further ado, let's get started.
https://d2kbulfv42d43j.cloudfront.net/2020/option_struct.png

Optional Parameters using Functional Options
· ☕ 5 min read
In Python we can set some parameters to default by doing option=True. But in Go we don't have that. In Go we do things differently. In Go we compose one function out of multiple helper functions. In this post we are going to explore the world of variadic function.
https://d2kbulfv42d43j.cloudfront.net/2020/functional_options.png