|
|
|
|
|
by vorg
2558 days ago
|
|
> The capitalisation is maybe the most annoying for me, I think it was designed with an IDE in mind If you don't have an IDE, you can start by making all functions and methods private. When you know you need it public, wrap the private function with the public one: func myF(ana int) { /*do something */ }
func MyF(ana int) { myF(ana) }
The same trick is often used for adding extra parameters to a function, except that the function body must be moved: func myG(a int) { myG2(a, 7) }
func myG2(a, b int) { /*do something*/ }
Adding publicness to a function is like adding an extra parameter to it. |
|