When it comes to object-oriented programming, there’s so much prior work done before Go, that a lot of newcomers to Go can’t help but to bring some concepts over. One of these concepts are object constructors, for which Go doesn’t have an equivalent.
Why constructors?
There are objects in Go that have to be initialized, for example channels and slices immediately come to mind. You’ll have to call make to set that up.
���The make built-in function allocates and initia...
Published on March 08, 2018 05:21