I want to access a private function of a package called "pastry". But it generates error as: invalid reference to unexported identifier
Specify the way by which private functions of golang are accessible in main.
I want to access a private function of a package called "pastry". But it generates error as: invalid reference to unexported identifier
Specify the way by which private functions of golang are accessible in main.
You can also add public proxy-function.
For example:
You have package-private function
func foo() int {
return 42
}
You can create public function in the same package, which will call the package-private function and return it's result
func Bar() int {
return foo()
}